0

How to detect Short & Long press of a push button

Jaya Cherlavancha 3 weeks ago in IQANdesign updated by Thomas Moberg (System support) 3 weeks ago 2

We need to implement a push button with a dual function, 

To achieve that, we would like to sense short press, long press, and the double or triple press of the push button,

Kindly let me know how to configure a push button in such a way

+1

A work around could be a timer starting/ending with pos/neg flank of the button pressed, combined with an ECNT

+1

You could make use of the delay on function for the long press.

Then have the single press react on the negative flank and also be blocked by the long press so that you do not activate both at the same time.

For the double press it gets more tricky.

i made an example here of one way to do it.

Button example.idsx