const int NUM_LEDS = 8;
const int DELAY_TIME = 100; // Adjust this for speed control
void setup() {
// Set pins 2 to 9 as output
DDRD = B11111111; // Set pins 2 to 7 as output
}
void loop() {
for (int i = 0; i < 0 + NUM_LEDS; i++) {
// Turn on LED at pin i
PORTD |= (1 << i);
delay(DELAY_TIME);
// Turn off LED at pin i
PORTD &= ~(1 << i);
}
}