7 years, 10 months ago.

coding for push button

i made the coding for push button. once the button push, the counting showed on LCD will decrease.

the problem is, the counting remains decreasing as long as the button pushed. help me to find solution. tq

Attach your code.....

posted by Dimitry Bresler 19 Jun 2016

1 Answer

7 years, 10 months ago.

You want to count the number of times the pushbutton is pressed ? Review how your pushbutton code is working and look for a release of the pushbutton.

https://developer.mbed.org/users/4180_1/notebook/pushbuttons/

The pushbutton is mechanical so the contacts will bounce around a lot inside the switch. You must debounce the mechanical switch so that only a single logic level is detected for a press and the opposite logic state when the switch is released. Then this logic can be used to count the number of times the pushbutton is pressed. The above webpage should offer all you need.

Accepted Answer