#define BLUE 19
#define RED 18
#define YELLOW 5
int btn = 15;
int count = 0;
void setup() {
//put your code here, to run once;
pinMode(BLUE, OUTPUT);
pinMode(RED, OUTPUT);
pinMode(YELLOW, OUTPUT);
pinMode(btn, INPUT);
}
void loop() {
if(digitalRead(btn) == 1){
if(count==0){
digitalWrite(BLUE, HIGH);
delay(1000);
digitalWrite(RED, HIGH);
delay(2000);
digitalWrite(YELLOW, HIGH);
count++;
}
else if(count==1){
digitalWrite(BLUE, LOW);
digitalWrite(RED, LOW);
digitalWrite(YELLOW, LOW);
count=0;
delay(500);
}
}
}