const int numLEDs = 4;
const int LEDPins[numLEDs] = {2, 3, 4, 5};
const int blinkDelays[numLEDs/2] = {3000, 5000}; // Delays for each pair of LEDs
void setup() {
for (int i = 0; i < numLEDs; i++) {
pinMode(LEDPins[i], OUTPUT);
}
}
void loop() {
for (int i = 0; i < numLEDs/2; i++) { // Loop for each pair of LEDs
for (int j = 0; j < numLEDs; j++) {
if (j < numLEDs/2) {
digitalWrite(LEDPins[j], i == 0 ? HIGH : LOW); // Turn on LEDs in the first pair for the first iteration, otherwise turn them off
} else {
digitalWrite(LEDPins[j], i == 1 ? HIGH : LOW); // Turn on LEDs in the second pair for the second iteration, otherwise turn them off
}
}
delay(blinkDelays[i]); // Wait for the specified delay
}
}