#include <stdint.h>
#define DDRA (*(volatile uint8_t*)0x21)
#define PORTA (*(volatile uint8_t*)0x22)
void delay1sec(void){
TCNT1 = 0;
TCCR1A = 0x00;
TCCR1B = 0x05;
while (TCNT1 < 15625);
TCCR1B = 0x00;
}
void setup() {
DDRA = 0xFF;
}
void port_led(int i){
PORTA = (1<<i) | (1<<(i+4));
delay1sec();
PORTA = 0x00;
delay1sec();
}
void loop() {
for(int i = 0; i <= 3; i++){
port_led(i);
}
}