??? 07/19/04 13:26 Read: times Msg Score: -3 -3 Didn't Search First |
#74455 - Push Button Bouncing Time Method |
Hi, I have an application where the micro controller LPC932 is waiting for a momentary push button to be pressed. I know there should be some time (msec.) to avoid false readings caused by bouncing. I am not using an interrupt in this procedure and I have no timers available. What will be a good approach to avoid this bouncing after pushing the button?
I am thinking something like this could work, but I would like to hear any other suggestions. Thanks // do other tasks. while (pushb != 0); // wait until button is // pressed // wait for about 40 msec. to avoid any double // counting due to contact bouncing // continue with other tasks |