7 years, 6 months ago.

push button led control

what i managed to accomplished, when i push a button the LED lights up when released it turns off.

next thing i want to do, when the button is first pressed, the led lights unless the button is pressed again, the led turns off..

can someone please guide me on how to start the logic?

1 Answer

7 years, 6 months ago.

Have a look at: http://mbed.org/users/4180_1/notebook/pushbuttons/

There somewhere at the bottom is code using DebounceIn that looks alot like what you want. You will have to change it a bit, but that should be doable :)