You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
Connect one side of the button to a ground pin, and the other to any GPIO
pin. Alternatively, connect one side of the button to the 3V3 pin, and the
other to any GPIO pin, then set *pull_up* to :data:`False` in the
:class:`Button` constructor.
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).
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: