sailingYOLO - Hi. I have a simple bilge sensor ...
Hi. I have a simple bilge sensor on/off connected to a GPIO, it works fine.
BUT I would like to be able to have it HIGH for x seconds before sending to SignalK due to false positives in coppy sea states.
Anyone have an idea? Thanks, Mattias.
3 Replies
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
A debounce transform does just that. On a shorter time scale, debouncing is used because all push buttons rattle/flicker back and forth when they're just about to make contact. But the same concept works perfectly well in larger time scales as well.
https://signalk.org/SensESP/generated/docs/classsensesp_1_1_debounce.html#details
Thank you for your answers, what a community 😃
Debounce was exactly what I was after, perfect! This is the code that works greate for a digital inputreader, and for me: