-
Notifications
You must be signed in to change notification settings - Fork 124
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
Button.watch spams endlessly #203
Comments
Hey @optikalefx, I'm a little late for the party, but - if you have not already solved it - I guess your PIN is floating! Meaning it has no defined HIGH or LOW value which triggers the library repeatedly, as the input value "floats" between HIGH and LOW. The reason it works with the python library is that it uses a pull-up by default (meaning it holds the pin high until you "short" it to GND. See their comment in the button-class of gpiozero:
The TLDR is if you use VCC-Button-PIN layout you must disable the pull_up. Either configure a pull up or make your own hardware-pullup (usually a resistor around 10k is all you need). Greetings |
I feel like I'm doing something wrong - when I run the sample code below, I just get an endless log. When I hit the button, the log stops.
I could work around that in my code, but I don't think that's how it's supposed to work. Isn't it supposed to only log a value when the interrupt happens?
For reference, this is pi3b+ on node22. The button is a simple 2 pin button wired to GPIO4 and GND. Also, it works fine in Python using
so I don't think it's hardware issue
The text was updated successfully, but these errors were encountered: