-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
the example
if (myInput.pressedFor(500)) {
// true (once only) if button has been pressed for 500ms
}
does not seem to work. I get repeated output with this code in Wokwi
#include <Toggle.h> // https://github.com/Dlloydev/Toggle
Toggle sw;
const unsigned long longPressDelay = 3000ul;
void setup() {
Serial.begin(115200);
sw.begin(3);
Serial.println("READY");
}
void loop() {
sw.poll();
if (sw.pressedFor(longPressDelay)) Serial.println("LONG PRESS");
}
is that a wokwi issue ?
what code would let me check for both short and long press on a button? checking for onPress() will not work with pressedFor() apparently.
Metadata
Metadata
Assignees
Labels
No labels