const byte LED_PINS[] = {7, 3, 10, 0, 1, 12, 6};
const byte LED_COUNT = sizeof(LED_PINS) / sizeof(LED_PINS[0]);
const unsigned long STEP_MS = 250;
void setup() {
for (byte i = 0; i < LED_COUNT; i++) pinMode(LED_PINS[i], OUTPUT);
}
void loop() {
for (byte i = 0; i < LED_COUNT; i++) {
digitalWrite(LED_PINS[i], HIGH);
delay(STEP_MS);
digitalWrite(LED_PINS[i], LOW);
}
}
Shared from Little Bird Electronics curriculum.