int buttonPin = 7;
void setup() {
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}
void loop() {
int buttonState = digitalRead(buttonPin);
if (buttonState == LOW){
Serial.println("Button is pressed");
}
else{
Serial.println("Button is not pressed");
}
delay(1000);
}