const int ledPins[] = {23, 19, 12, 14}; // Pins connected to LEDs
const int numLeds = 4; // Number of LEDs
void setup() {
// Initialize each LED pin as an output
for (int i = 0; i < numLeds; i++) {
pinMode(ledPins[i], OUTPUT);
}
}
void loop() {
// Loop through each LED, turn it on and off
for (int i = 0; i < numLeds; i++) {
digitalWrite(ledPins[i], HIGH); // Turn the current LED on
delay(1000); // Wait for a short duration to create the blinking effect
digitalWrite(ledPins[i], LOW); // Turn the current LED off
delay(1000); // Wait for a short duration between LEDs
}
}