int timer = 5000; int solid[] = { A0, A1, A2, A3 }; int pinCount = 4; int sw[]={6}; void setup() { for (int thisPin = 0; thisPin < pinCount; thisPin++) { pinMode(solid[thisPin], OUTPUT); } pinMode(sw[0], INPUT); digitalWrite(sw[0], HIGH); } void loop() { if(digitalRead(sw[0]) == LOW) { for (int thisPin = 0; thisPin < pinCount; thisPin++) { digitalWrite(solid[thisPin], HIGH); delay(timer); digitalWrite(solid[thisPin], LOW); } } }