//connect leds to port A glow in this order 0,2,1,3,4,6,5,7
#include <stdint.h>
#define DDRA (*(volatile uint8_t*)0x21)
#define PORTA (*(volatile uint8_t*)0x22)
uint8_t pattern[8] = {0, 2, 1, 3, 4, 6, 5, 7};
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 < 8; i++) {
PORTA = (1 << pattern[i]);
delay1sec();
PORTA = 0x00;
delay1sec();
}
}