const int LED_PINS[] = {2, 4, 16, 17, 5, 18, 19, 21};
const int NUM_LEDS = sizeof(LED_PINS) / sizeof(LED_PINS[0]);
void setup() {
for (int i = 0; i < NUM_LEDS; i++) {
pinMode(LED_PINS[i], OUTPUT);
}
}
void apagarTodosLeds() {
for (int i = 0; i < NUM_LEDS; i++) {
digitalWrite(LED_PINS[i], LOW);
}
}
void loop() {
//Desplazar los LEDs hacia adelante
for (int i = -2; i < NUM_LEDS; i++) {
digitalWrite(LED_PINS[i], HIGH);
delay(150);
delay(150);
}
apagarTodosLeds();
delay(150);
}