Reset program after the condition is met

Hi, @Arthon
I can see you are just over printing your count on the LCD.
This means if you print a four digit number then a three digit number, the fourth digit will not change.
What you do is before you update the number, print blanks in its place, like below.

  lcd.setCursor(0, 0);
  lcd.print("Button Count");
  lcd.setCursor(0, 1);
  lcd.print("     ");
  lcd.setCursor(0, 1);
  lcd.print(Y+A+Z);

See if that helps.

I am not sure if your switch.. case formatting is correct.

Tom... :grinning: :+1: :coffee: :australia: