byte pins[] = {
3, 4, 5, 6, 7
};
int s = sizeof(pins);
void setup() {
for (int i = 0; i < s; i++) {
int p = pins[i];
pinMode(p, OUTPUT);
}
}
void loop() {
for (int i = 0; i < s; i++) {
for (int j = i; j < s; j++) {
digitalWrite(pins[j], HIGH);
}
delay(100);
for (int j = i; j < s; j++) {
digitalWrite(pins[j], LOW);
}
delay(100);
}
delay(400);
}