COUNT NUMBER WHEN A SWITCH IS PRESSED

A QUICK RESPONSE IS APRRECIATED

I HAVE A UNO R3 WITH A MOTOR DRIVER OF 3RD PART INSTALLED , THE MOTOR DRIVER HAS 2 SWITCH BUTTONS

I want to write a code to see how many times a switch is pressed for example :--

LETS ASSUME

SWITCH 1 IS BUTTON 1
SWITCH 2 IS BUTTON 2

IT IS LIKE A VOTING MACHINE

I WOULD LIKE THE COUNT AT THE END OF 5 MINS HOW MANY TIMES BUTTON 1 OR BUTTON 2 WAS PRESSED

THANKS

The state change detection example does almost everything you want. All you'd need to add is the 5 minute time frame.

"A QUICK RESPONSE IS APRRECIATED"
Sure - turn off your Caps Lock, that's like shouting when on-line.