//glow the leds in following order 01,67,23,45
#include <stdint.h>
#define DDRA (*(volatile uint8_t*)0x21)
#define PORTA (*(volatile uint8_t*)0x22)
uint8_t pattern[4] = {
0x03, // 01
0xC0, // 67
0x0C, // 23
0x30 // 45
};
void delay1sec(void){
TCNT1 = 0;
TCCR1A = 0x00;
TCCR1B = 0x05;
while (TCNT1 < 15625);
TCCR1B = 0x00;
}
void setup() {
DDRA = 0xFF;
}
void loop() {
for (uint8_t i = 0; i < 4; i++) {
PORTA = pattern[i];
delay1sec();
PORTA = 0x00;
delay1sec();
}
}