#define RED 12
#define GREEN 11
#define BTN1 8
void setup() {
pinMode(BTN1, INPUT);
pinMode(RED, OUTPUT);
pinMode(BTN1, INPUT_PULLUP);
}
void loop() {
if (digitalRead(BTN1)) {
digitalWrite(RED, LOW);
delay(200);
} else {
digitalWrite(RED, HIGH);
delay(200);
}
}