#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
int buttonCounter = 2;
int buttonReset = 3;
int butt1 = LOW;
int butt2 = LOW;
int counter = 0;
void setup() {
pinMode(buttonCounter, INPUT_PULLUP);
pinMode(buttonReset, INPUT_PULLUP);
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print(counter);
}
void loop() {
butt1 = digitalRead(buttonCounter);
butt2 = digitalRead(buttonReset);
if (butt1 == LOW) {
counter++;
lcd.setCursor(0, 0);
lcd.print(counter);
delay(300);
}
if (butt2 == LOW) {
counter = 0;
lcd.setCursor(0, 0);
lcd.print(" ");
lcd.setCursor(0, 0);
lcd.print(counter);
delay(300);
}
}