#include <LiquidCrystal_I2C.h>
#define button 25
LiquidCrystal_I2C lcd(0x27, 22, 21);
int count = 0;
void setup() {
Serial.begin(115200);
pinMode(button, INPUT_PULLUP);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Count: ");
lcd.print(count);
}
void loop() {
int bstate = digitalRead(button);
if (bstate == LOW) {
count++;
lcd.setCursor (7, 0);
lcd.print(count);
Serial.print("Count: ");
Serial.println(count);
delay(500);
}
}