#define LED_1 2
#define LED_2 4
#define LED_3 5
#define LED_4 18
#define S1 13
#define LED_5 14
void setup() {
pinMode(S1, INPUT);
pinMode(LED_1, OUTPUT);
pinMode(LED_5, OUTPUT);
pinMode(LED_2, OUTPUT);
pinMode(LED_3, OUTPUT);
pinMode(LED_4, OUTPUT);
digitalWrite(LED_1, LOW);
digitalWrite(LED_2, LOW);
digitalWrite(LED_3, LOW);
digitalWrite(LED_4, LOW);
digitalWrite(LED_5, LOW);
}
void loop() {
if (digitalRead(S1) == LOW){
digitalWrite(LED_3 , LOW);
digitalWrite(LED_1 , HIGH);
delay(1000);
digitalWrite(LED_1, LOW);
digitalWrite(LED_2 , HIGH);
delay(1000);
digitalWrite(LED_2, LOW);
digitalWrite(LED_3 , HIGH);
delay(1000);
}
else{
digitalWrite(LED_1, HIGH);
}
}