#define BUTTON_PIN 12 // switch input Active Low
#define pressed LOW
void setup() {
Serial.begin(9600);
pinMode(BUTTON_PIN, INPUT_PULLUP);
}
void loop() {
int value = digitalRead(BUTTON_PIN);
if(value == pressed) {
Serial.println("Pressed Switch.");
delay(500);
}
}