//SERIAL PRINT
int BTN = 12;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(BTN, INPUT_PULLUP); //so pin 12 is HIGH
}
void loop() {
// put your main code here, to run repeatedly:
//Serial.println(digitalRead(BTN));
//delay(1000);
{
if (digitalRead(BTN) == LOW)
{
Serial.println("The button is pressed. The LED is on.");
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
}
else
{
digitalWrite(LED_BUILTIN, LOW);
Serial.println("The button is not pressed and the LED is off.");
delay(1000);
}
}
}