#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
const int buttonPin = 2;
int buttonState = 0;
int lastButtonState = HIGH;
int counter = 0;
void setup() {
lcd.begin(16, 2);
pinMode(buttonPin, INPUT_PULLUP);
lcd.setCursor(0, 0);
lcd.print(counter);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == LOW && lastButtonState == HIGH) {
counter++;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(counter);
delay(200);
}
lastButtonState = buttonState;
}