int LED[7] = {27, 26, 25, 32, 33, 14, 13};
int BUTTON = 35;
int currentLED = 0;
bool lastButtonState = HIGH;
bool ledCycling = false;
void setup() {
for(int i=0;i<7;i++) {
pinMode(LED[i], OUTPUT);
}
pinMode(BUTTON, INPUT_PULLUP);
}
void loop() {
int buttonState = digitalRead(BUTTON);
if (buttonState != lastButtonState) {
if (buttonState == LOW) {
ledCycling = !ledCycling;
}
delay(50);
}
lastButtonState = buttonState;
if (ledCycling) {
for (int i = 0; i < 7; i++) {
digitalWrite(LED[i], LOW);
}
digitalWrite(LED[currentLED], HIGH);
currentLED++;
if (currentLED >= 7) {
currentLED = 0;
}
delay(200);
}
}