I need to adda Hold press to a button, how long is the hold set for before it fires, in my testing it appears to work exactly the same as a click
Hold fires after approximately 500 ms.
A click will fire if you press the button and release it before 500 ms have elapsed. If you release it after that time, nothing will happen.
From ADU Manual:
how is it recommented to implement this button logic for functions?
If I have button 1 (analogue in). Function 1 is press, function 2 is hold (delay true 0,5s).
In this case of button hold, Function 1 and Function 2 will also be true, and I only want function 2.
Thank you!
Please check the project in the attachment; I hope this is what you expected.
clickHoldButtonPrjectTree.adu (7.2 KB)
thank you for the quick reply, but using 8 operations (based on Memory report) for something so simple is unrealistic in a real project, specially, as ADU already has this functionality for the standard buttons for Click/hold.
You asked about the implementation, so I did it for you.
There is a “press/hold” switch type available in the “Switch” element, but it always goes through the middle state, but maybe it will be enough for your purposes, have you checked it?
We’ll consider adding native support for this kind of click/hold behavior to the switch element in the future.
thanks! I will look into it. it can work for me sometimes, I can free up some function operations with this maybe.