#define LED1 19
#define LED2 5
#define LED3 18
int btn = 2;
int hit = 0;
void setup() {
// put your setup code here, to run once:
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(btn, INPUT);
}
void loop() {
if (digitalRead(btn) == 1) {
if (hit==0) {
digitalWrite(LED2, HIGH);
delay(3000);
digitalWrite(LED2, LOW);
digitalWrite(LED1, HIGH);
delay(5000);
digitalWrite(LED2, HIGH);
delay(2000);
digitalWrite(LED2, LOW);
digitalWrite(LED1, LOW);
delay(500);
digitalWrite(LED3, HIGH);
delay(3000);
hit++;
delay(500);
// digitalWrite(LED1, LOW);
// digitalWrite(LED2, LOW);
// digitalWrite(LED3, LOW);
} else {
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
hit=0;
delay(500);
}
}
}