#define LED_PORT PORTA // Define PORTA as LED output
#define LED_DDR DDRA // Define Data Direction Register for PORTA
void setup() {
LED_DDR = 0xFF; // Set all PORTA pins as output (pins 22-29)
}
void loop() {
// Turn on and turn off LEDs one by one in ascending order
for (uint8_t i = 0; i < 8; i++) {
LED_PORT = (1 << i); // Turn on one LED at a time
delay(1000); // Delay for 1 second
LED_PORT = 0x00; // Turn off the LED
delay(1000); // Delay for 1 second before the next LED
}
}