// pattern 7,76,765,7654,76543,765432,7654321,76543210
//0,01,012,0123,01234,.....01234567
#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 loop() {
for (uint8_t i = 7; i >=0; i--) {
PORTA |= (1<<i);
delay1sec();
}
}