#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 LEDs one by one in ascending order
for (uint8_t i = 0; i < 8; i++) {
LED_PORT |= (1 << i); // Light up one LED at a time without turning off previous ones
delay(200); // Delay for visibility
}
// Turn off LEDs one by one in ascending order
for (uint8_t i = 0; i < 8; i++) {
LED_PORT &= ~(1 << i); // Turn off one LED at a time
delay(200);
}
}