Count how many times dfrobot lcd button was pressed

Hello!! I'm currently using a dfrobot lcd keypad shield which has 6 button(SELECT, LEFT, RIGHT, UP, DOWN , RST). I'd like to create a programme that counts how many times the SELECT button has been pressed. Can anyone help me with a code idea?

Give yourself a variable called say “buttonCount “; if the button is pressed then buttonCount++

You need to look at state change examples to make sure you only count once if the button is held down ( only increment if a not pressed state occurs after button is pressed) .
You will probably need to denounce the button too .
There is a few things to research

StateChangeDetection

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.