//connect 8 leds to port L glow 0-3 leds one by one
#include <stdint.h>
#define DDRL (*(volatile uint8_t*)0x10A)
#define PORTL (*(volatile uint8_t*)0x10B)
void delay1sec(void){
TCNT1 = 0;
TCCR1A = 0x00;
TCCR1B = 0x05;
while (TCNT1 < 15625);
TCCR1B = 0x00;
}
void setup() {
DDRL |= (1<<0) | (1<<1) | (1<<2) | (1<<3);
}
void loop() {
for (uint8_t i = 0; i < 4; i++) {
PORTL = (1 << i);
delay1sec();
PORTL = 0x00;
delay1sec();
}
}