I have a GPIO that keeps bouncing on/off which I'm thinking is due to inference but before I go ripping out cabling I wanted to try and fix it via software. Before I get started let me just say I know about debouncing on a GPIO, I have tried it but due to the length of the bouncing it renders the usability null.
What I was thinking was connect the GPIO output to a function node that just sets the output as a flow variable.
Then have another function node that loops forever, inside said loop detect when the flow variable changes value. This triggers a child loop to check the state of the flow variable for X seconds, if the state has stayed the same value for all the X seconds then send an async msg allowing the change. if however, it bounced then it's a false positive and no async is sent.
Essentially what I want to do is check the value hasn't changed in a set time vs debouncing which uses the first value, ignores for x seconds and compares again.