weasel1088 Posted July 20, 2022 Posted July 20, 2022 (edited) I am working on a Tomcat UHF button box with lcd screen. I have an arduino mega all programmed up and working with DCS bios except for one thing. I have 4 momentary on-off-on switches that are programmed to change the frequency. When I flip any of these switches the tomcat responds by holding the switch for 2-3 seconds which increases the frequency by 3 steps. Basically something is going on and my button presses are registering as being held for longer than I am physically holding the switch. I also notice a little lag between the lcd display update and changes I make. Not sure if those two things are related. But the main question is how do I code the button presses to be shorter in duration. DCS-bios doesn’t really seem to offer any delay or “debounce” I think maybe is the term? Any suggestions? I can post my code if anyone is interested but it’s basically just a copy and paste from the DCS bios literature. Thanks! Edited July 20, 2022 by weasel1088
crash test pilot Posted July 20, 2022 Posted July 20, 2022 A little capacitor might do the trick: http://www.gammon.com.au/forum/?id=11955 See chapter "Hardware debouncing".
No1sonuk Posted July 20, 2022 Posted July 20, 2022 +1 for trying a capacitor. Though I usually use 0.1 uF (100nF).
Recommended Posts