void loop() {
if (digitalRead(8)==HIGH)
{
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
delay(2000);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
delay(3000);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
delay(4000);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
delay(5000);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
delay(6000);
digitalWrite(7, LOW);
}
if (digitalRead(8)==LOW)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
}