#define BUTTON_PIN 13
#define LED1 3
void setup()
{
Serial.begin(9600);
pinMode(BUTTON_PIN, INPUT_PULLUP);
pinMode(LED1, OUTPUT);
}
void loop()
{
byte buttonState = digitalRead(BUTTON_PIN);
if (!buttonState) {
Serial.println("Button is pressed");
digitalWrite(LED1, HIGH);
}
else {
Serial.println("Button is not pressed");
digitalWrite(LED1, LOW);
}
}