-
Notifications
You must be signed in to change notification settings - Fork 38
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 presses not recognized at all or random #19
Comments
Hi, I think the reason your first sample code works is that you make a call to For a problem like this, I recommend going to one of the example code that I provided in the Hope this helps. |
Thanks for the reply! I just read "handles both pull-up and pull-down wiring" in the Readme and in the docs I read "When using a pullup resistor (either external or internal) and the button is connected to ground, this should be set to HIGH.". That lead me to assume that the library would take care of setting the internal pull-up resistor. Edit: |
Glad that it fixed your problem. I made a somewhat conscious decision to decouple the configuration of the hardware from the AceButton library. The library doesn't really care whether you are using an internal pull-up or an external pull-up resistor. It just needs to know the logical value of the button in the default (unpressed) state. If the library handled the call to I think all my examples in the README.md contain a call to |
AceButton version: 1.3.2
Arduino IDE version: 1.8.5
Arduino: Arduino Micro (A clone, not the original one. The IDE recognizes the Arduino as an "Arduino Leonardo". )
The click and long press events aren't triggered at all no matter if I press the button for only a few milliseconds or for a long time. Sometimes instead of not reacting at all it just thinks it is constantly receiving presses. It works just fine and as expected when I simply use digitalRead instead.
I minimized the code to a minimum and even took the button and anything else connected to the Arduino out of the equation, I only used a wire to "short" GND to a digital pin (I tried many different pins including 2, 3, 4 and 9). Just to make sure I opened up another brand new Arduino Micro clone, but I had the exact same issues. I also tried instantiating with
AceButton leftPedal(LEFT_PEDAL, HIGH);
andAceButton leftPedal(LEFT_PEDAL, LOW);
. But still it didn't behave correctly. (I'm not using an external pull-down resistor btw, just a wire.)This works perfectly fine:
This code misbehaves as described above:
I spent the last 4 hours desperately trying to get this to work. I would really appreciate it if you could check this out and tell me what the problem is.
The text was updated successfully, but these errors were encountered: