Announcement

Collapse
No announcement yet.

Momentary button, non debouncing...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Momentary button, non debouncing...

    Is it possible for a winbutton, or any other button, work as a single press *and* long press button as well? I am replacing a 4 button switch using a 74HC4066 and the buttons can be either push or long pressed for different functions.
    Thanks,
    Tony

  • #2
    If you set momentary to 'both' then you will get a message when the button is pressed and again when it is released. Calculate the difference between the press and the release and you can work out if it was a short of long press.
    Mark

    Comment


    • #3
      thanks

      Comment


      • #4
        well rather than count, i just write the enable pin of the 74hc4066 high which activates the button, on the release event it brings it back low, works good and doesnt delay the response like the counting would. if i did it the counting way it would just press the button, wait, then when it received the release event it would then press the actual button, making it look like a delayed push. the code is very minimal and doesnt stop other stuff from processing either
        Last edited by tonton81; 5 May 2016, 11:10 AM.

        Comment

        Working...
        X