/*******************************************************************
by arvind date 22/1/24
**********************************************************************/
const int numLeds = 28; // Number of LEDs
int ledIOPins[numLeds] = {1,2,3, 4, 5, 6,7,8, 9, 10,11,12,13,14,15,16,17,18,19,21,22,35,36,37,38,39,40}; // Define the GPIO pins for each LED
void setup() {
for (int i = 0; i < numLeds; i++) {
pinMode(ledIOPins[i], OUTPUT); // Set each LED pin as an output
}
}
void loop() {
// Forward direction
for (int i = 0; i < numLeds; i++) {
digitalWrite(ledIOPins[i], HIGH); // Turn on the current LED
delay(100); // Adjust the delay as needed for the desired speed
digitalWrite(ledIOPins[i], LOW); // Turn off the current LED
}
delay(200); // Pause at the end
for (int i = numLeds - 1; i >= 0; i--) {
digitalWrite(ledIOPins[i], HIGH); // Turn on the current LED
delay(100); // Adjust the delay as needed for the desired speed
digitalWrite(ledIOPins[i], LOW); // Turn off the current LED
}
delay(1800); // Pause at the end
}