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
first thanks for this great library which saves me a lot of time for developing my smart home shutter control.
I try to detect and count multiple clicks of a button, but the results for multiple clicks > 2 are not correct, while detecting single and double clicks works correctly.
This is my code:
rollo1_taster_hoch = OneButton(
CONTROLLINO_A0, // Input pin for the button
false, // Button is active high
true // Enable internal pull-up resistor
);
rollo1_taster_hoch.attachMultiClick(handleMultiClick);
static void handleMultiClick(OneButton *oneButton) {
Serial.print("Number of clicks: ");
Serial.print(oneButton->getNumberClicks());
if(oneButton->getNumberClicks() == 5) {
Serial.println("5 klicks");
}
}
For 3 clicks the serial output is: "Number of clicks 55"
For 4 clicks: Number of clicks 0
For 5 clicks: Number of clicks 768
For 6 clicks: Number of clicks 771
These values are reproducible when clicking the same number of times again.
Does anyone have an idea what could cause these wrong values?
The text was updated successfully, but these errors were encountered:
theclayman
changed the title
Detecting multiple clicks returns wrong values for > 3
Detecting multiple clicks returns wrong values for > 2
Nov 18, 2023
Hello,
first thanks for this great library which saves me a lot of time for developing my smart home shutter control.
I try to detect and count multiple clicks of a button, but the results for multiple clicks > 2 are not correct, while detecting single and double clicks works correctly.
This is my code:
For 3 clicks the serial output is: "Number of clicks 55"
For 4 clicks: Number of clicks 0
For 5 clicks: Number of clicks 768
For 6 clicks: Number of clicks 771
These values are reproducible when clicking the same number of times again.
Does anyone have an idea what could cause these wrong values?
The text was updated successfully, but these errors were encountered: