Timeline for Detecting if a push button was pressed and released
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 27, 2018 at 11:54 | comment | added | sa_leinad | @Systembolaget Please still put it as an answer. It will help others who have the same problem as the OP. Plus sometimes a simple and concise answer is more helpful than a long wordy answer (at least to some people). | |
| Jul 26, 2018 at 16:48 | comment | added | Systembolaget | @sa_leinad Well, the OP (Mr. Bucher) already received a complex answer to a simple problem and accepted it as best answer ; ) | |
| Jul 24, 2018 at 8:33 | comment | added | Systembolaget | "I usually put a capacitor next to my push button" Yep, a 1uF capacitor across the button. No need to fiddle with code. See Nick Gammon's excellent switch tutorial gammon.com.au/switches that covers all kinds of conceivable situations (high or low, GND or +5V, internal pull-up or pull-down, capacitor debounce or software debounce, etc.) | |
| Feb 22, 2018 at 1:36 | comment | added | sa_leinad | The voltage across the capacitor rises slowly in spite of the bouncing switch, and increasing the component values will make it even slower to reach the logical high. Component values could be changed about until the ideal charge and discharge rates cause a delay that outlasts the bouncing and a stable interval has passed. - Excerpt from Debouncing switches in hardware and software | |
| Feb 22, 2018 at 1:30 | comment | added | sa_leinad |
The values come from the RC timing constant t = RC. You want to aim for a few milliseconds to get any reduction in the button switching noise. A good article is from the Embedded with Elliot blog: hackaday.com/2015/12/09/…
|
|
| Feb 20, 2018 at 17:41 | comment | added | Kelly S. French | @sa_leinad could you comment on why you chose the capacitor value (100nF) you did? | |
| Jan 1, 2018 at 11:28 | comment | added | Patrick Bucher | I usually put a capacitor next to my push button in order to get a clean up/low signal right away. | |
| Jan 1, 2018 at 5:49 | history | answered | sa_leinad | CC BY-SA 3.0 |