Open zapphyre opened 1 year ago
I saw that too, I had to remove that INPUT_PULLUP. otherwise this library is good. I found it just today and it really simplifies a lot :)
This is an easy fix. If the button is initialized in INPUT_PULLUP mode, invert the state of the button in both places where DigitalRead is called.
A simple fix is change the 1st line of checkDebounceStatus() to: bool bNewButtonState = digitalRead(uiButtonPin) ^ bQuiescentButtonState;
and then up the top of the file, set the logic polarity... // Initialise internal variables ulLastStatusUpdate_MS = millis(); bQuiescentButtonState = digitalRead(uiButtonPin); bDebouncedButtonState = false;
in my trials
ACKSEN_BUTTON_MODE_ACCELERATE
does not work withINPUT_PULLUP
mode. what that means is.onPressed()
gets called all the time like it's reacting to the HIGH pin value, but in this case the logic should be inverted and it should react only on LOW as internal pull-up was activated.ACKSEN_BUTTON_MODE_NORMAL
seems to act as expectedarduino MKR1000 arduino ide v.2.0