-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input debounce? #10
Comments
This has nothing to do with the library but is a very common occurrence with push buttons where the electrical signal is picked up multiple times due to mechanical reasons (commonly referred to as bouncing). You can either fix this in hardware (https://www.digikey.de/en/articles/how-to-implement-hardware-debounce-for-switches-and-relays) or software (https://docs.arduino.cc/built-in-examples/digital/Debounce). |
Thanks, I was hoping for something similar with the 'onoff' module. |
This library only wraps the libgpiod with a nodejs api. Debouncing isn't built in but it is easy enough to do. Feel free to provide a PR to add it as an additional module. Something like passing in a Line instance into a PushButton instance (or something like it) and have it available for all people in the future :) |
If I ever get proficient with js I will :-)
Thanks.
|
I'm guessing another solution to this would be the monitoring callbacks but that's not yet implemented, but the idea is that it monitors any changes on the input pins selected and logs an event of raise or fall of an edge. |
closing but hopefully will get solved when monitoring finally gets implemented. see #23 |
Hi, first off, I'm trying to learn nodejs and gpio, and your module is the most platform independent I could find.
Almost all of gpio module for nodejs is geared toward raspberry pi, I'm on an Alwinner (nanopi neo) SOC.
The module works as demoed, but I'm using buttons and sometimes I'm getting more than one result on a single press,
Do you know of a workaround for it?
The text was updated successfully, but these errors were encountered: