int leds[] = {13, 12, 11, 10, 9};
int currentState[] = {LOW, LOW, LOW, LOW, LOW};
int currentHighLed = 0;
void setup() {
for (int i = 0; i < sizeof(leds)/sizeof(int); i=i+1) {
pinMode(leds[i], OUTPUT);
//INPUT: to read the tension value on this pin
//OUTPUT: to regulate the tension value on this pin: e.g. switch on / off
}
}
void loop() {
for (int i = 0; i < sizeof(leds)/sizeof(int); i= i+1) {
digitalWrite(leds[i], currentState[i]);
}
currentState[currentHighLed] = HIGH;
delay(700);
currentHighLed= currentHighLed+1;
if (currentHighLed > 5) {
currentHighLed = 0;
for (int i = 0; i < sizeof(leds)/sizeof(int); i= i+1) {
currentState[i] = LOW;
}
delay (1000);
}
}