const int buttonPin = 2;
int count = 0;
void setup() {
Serial.begin(115200);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
if (digitalRead(buttonPin) == LOW) {
count = 0;
Serial.println("Counter Reset!");
delay(300);
}
Serial.println(count);
count++;
delay(1000);
}