const byte LED = 8; // Pin connected to the LED
const byte flash_button = 2; //Pin connected to the flash button (BLUE)
const byte turn_off_button = 12;//Pin connected to the turn off button (GREEN)
void setup() {
pinMode(LED , OUTPUT);
pinMode(flash_button, INPUT_PULLUP);
pinMode(turn_off_button, INPUT_PULLUP);
}
void loop() {
if ( digitalRead(turn_off_button) == LOW ) //GREEN preseed
{
digitalWrite(LED , LOW); // LED is turned off until the turn off button isreleased
}
else if (digitalRead(flash_button) == LOW) // BLUE pressed
{
digitalWrite(LED , HIGH); //LED shines continuously until the flash button is released
}
else // blinking 500ms
{
digitalWrite(LED , HIGH);
delay(500);
digitalWrite(LED , LOW);
delay(500);
}
}