PDA

View Full Version : Two Button detect for long press same time



Gevo
- 15th May 2025, 14:52
Hi all,

I have on a panel two capacitive buttons, Fan (three steps) and Light control (three steps)

Short press -> Fan step_1, press -> Step_2 press -> Step_3. Same with te Light button.

But, I try to make a config setting with these two buttons.

If hold the two buttons on the same time for 5 sec down, jump to the menu.

Any advice for this? making for each button a LoopTime to detect long or short press?

richard
- 16th May 2025, 02:03
what have you tried ?
what chip are you using? can you provide a schematic


https://www.picbasic.co.uk/forum/showthread.php/21109-Multi-Button-CSM-with-Pic16LF722A

amgen
- 16th May 2025, 16:13
so, I have made a exhaust fan timer with 1 mom button that will.... depending on press duration do..
----- >50ms and < 2seconds..... run fan for the programmed time of 15, 30, 60 or 120 minutes
---- continued press of >2 sec and < 5 sec times the fan for an 8 hour period then turns off
---- continued press of >5sec and held here until let go enters the programming mode for 30 seconds where the button is pressed once or twice or 3X or 4X to set the base run time for normal operation.... In any modes while running, a switch press turns cycle to off
*** I did it with for/next's and if's and repetitive small pauses for the timing
*** For2 buttons, I would work the first button pressed to completion then go on to continue on to checking for other or next sw press check