// connect 8 leds to port A glow the leds in this order 37,26,15,04
#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() {
// put your setup code here, to run once:
DDRA |= 0xff;
}
int i;
int port(int i){
PORTA |= (1<<i) | (1<<(i+4));
delay1sec();
PORTA &= ~((1<<i) | (1<<(i+4)));
delay1sec();
}
void loop() {
for(int i=0; i<4; i++){
port(i);
}
}