const int buttonPin = 7; int lastState = HIGH; void setup() { Serial.begin(9600); pinMode(buttonPin, INPUT_PULLUP); } void loop() { int state = digitalRead(buttonPin); if (state == LOW && lastState == HIGH) { Serial.println("PRESS"); delay(200); } lastState = state; }