// Include required libraries
#include <Arduino.h>
// Define the pins for the LEDs
const int ledPins[] = {4, 0, 2, 15}; // Change pins as per your setup
// Define the time interval for blinking
const int blinkInterval = 500; // Blink interval in milliseconds
void setup() {
// Set all LED pins as output
for (int i = 0; i < 4; i++) {
pinMode(ledPins[i], OUTPUT);
}
}
void loop() {
// Pattern A: All LEDs off
allOff();
delay(blinkInterval);
// Pattern B: All LEDs on
allOn();
delay(blinkInterval);
}
void allOff() {
// Turn off all LEDs
for (int i = 0; i < 4; i++) {
digitalWrite(ledPins[i], LOW);
}
}
void allOn() {
// Turn on all LEDs
for (int i = 0; i < 4; i++) {
digitalWrite(ledPins[i], HIGH);
}
}