Suggestion for implementing 'setLongReleasedDelay' #118
Replies: 6 comments 5 replies
-
I've been mulling over this for a few days, and I think I understand what you are trying to do. The problem is that the current The current Your version of If we were to implement your version of So I have a counter-suggestion: You are essentially using the LongPressed event to perform debouncing of your water level switch at a much larger timescale than the usual 20-50 milliseconds. You want to do debouncing at the level of 5-10 seconds. So instead of using LongPressed, is it possible to achieve your goals by using the normal |
Beta Was this translation helpful? Give feedback.
-
(Moved to Discussion because this is a feature request) |
Beta Was this translation helpful? Give feedback.
-
Hello, @bxparks I tried to use long debouncing (5 seconds), but the result was not good, because debouncing has a specific purpose: Filtering noise and state change (on or off) of button or switch contacts.
One detail is that this is not a typical behavior of Humans, but of a water level float. However, it would be very good if Acebutton addressed the behavior of buttons and switches in general, whether they are used with human behavior or triggered by elements of nature (water, wind...), such as a water level float. |
Beta Was this translation helpful? Give feedback.
-
Therefore, the closest example of what I think is available in the Easybutton library. But I'm incorporating Acebutton into my code as it has many more features and settings, the exception of which would be Easybutton's Thank you very much for your attention |
Beta Was this translation helpful? Give feedback.
-
This observation is perfect. The question we ask is: A water float is activated by nature (water, wind...), and not by a human. But we understand if it's not feasible to implement in the Acebutton library. Thank you very much. ❤️❤️❤️ 👏👏👏 |
Beta Was this translation helpful? Give feedback.
-
I just released v1.10.0 of this library. See the CHANGELOG.md for the changes, but the thing that is of interest to you is the new |
Beta Was this translation helpful? Give feedback.
-
Hello, @bxparks
Thank you so much for this GREAT library!
I started using the Acebutton library in my projects and I'm really enjoying it.
I used the EasyButton library in my projects.
With EasyButton it was possible to use the function to identify how long a button was released [ex:
button.releasedFor(releasedForTime)
]; .However, I haven't found a way to do this with Acebutton.
See here: https://easybtn.earias.me/docs/released-for-api/
This function is especially important when we want to identify the state of a water float . The problem is that water waves/ripples can change the float state from HIGHT to LOW quickly (see image below).
I'm trying the following approach:
The problem is that
kEventLongReleased
is quickly triggered when water waves/ripples change the float state from HIGHT to LOW.Therefore, it would be important to assign a delay to
kEventLongReleased
, something like asetLongReleasedDelay
method:With
setLongReleasedDelay(10000);
thekEventLongReleased
event would not be triggered on the ripples of the water, but only when it stabilizes for a period of 10 seconds (in the example above).Would this implementation in Acebutton be viable? This was the only EasyButton functionality that I didn't find in Acebutton.
Beta Was this translation helpful? Give feedback.
All reactions