//BTN LED INPUT_PULLUP
int LED_PIN = 5;
int BTN_YELLOW = 6;
int BTN_RED = 7;
void setup()
{
pinMode(LED_PIN, OUTPUT);
pinMode(BTN_YELLOW, INPUT_PULLUP); //PULLUP makes the pin HIGH
pinMode(BTN_RED, INPUT_PULLUP);
}
void loop()
{
//with PULLUP when button pressed it will go LOW
//check both buttons are pressed, then blink the LED
if ((digitalRead(BTN_YELLOW) == LOW) && (digitalRead(BTN_RED) == LOW))
{
digitalWrite(LED_PIN, HIGH);
delay(1000);
digitalWrite(LED_PIN, LOW);
delay(1000);
}
else
{
digitalWrite(LED_PIN, LOW);
}
}