#include <Arduino.h> // Include the Arduino.h header
#define led 1
int bulbPins[] = {32, 33, 25}; // Array to hold the pin numbers of the bulbs
int numBulbs = sizeof(bulbPins) / sizeof(bulbPins[0]); // Calculate the number of bulbs
int cycleDuration = 1000; // Duration in milliseconds for each phase of the cycle
int numCycles = 10; // Number of cycles to run
void setup() {
for (int i = 0; i < numBulbs; i++) {
pinMode(bulbPins[i], OUTPUT); // Set each bulb pin as an output
}
}
void loop() {
for (int cycle = 0; cycle < numCycles; cycle++) {
for (int i = 0; i < numBulbs; i++) {
digitalWrite(bulbPins[i], HIGH); // Turn on the current bulb
delay(cycleDuration);
digitalWrite(bulbPins[i], LOW); // Turn off the current bulb
}
delay(cycleDuration); // Pause between cycles
}
}
int main() {
setup(); // Call the setup function
while (1) {
loop(); // Call the loop function repeatedly
}
return 0;
}
/*
/*
int main() {
int bulbPins[] = {32, 33, 25}; // Array to hold the pin numbers of the bulbs
int numBulbs = sizeof(bulbPins) / sizeof(bulbPins[0]); // Calculate the number of bulbs
for (int i = 0; i < numBulbs; i++) {
pinMode(bulbPins[i], OUTPUT); // Set each bulb pin as an output
}
int cycleDuration = 1000; // Duration in milliseconds for each phase of the cycle
int numCycles = 10; // Number of cycles to run
for (int cycle = 0; cycle < numCycles; cycle++) {
for (int i = 0; i < numBulbs; i++) {
digitalWrite(bulbPins[i], HIGH); // Turn on the current bulb
delay(cycleDuration);
digitalWrite(bulbPins[i], LOW); // Turn off the current bulb
}
delay(cycleDuration); // Pause between cycles
}
return 0;
} */