// Stepper motor on Wokwi!
#include <Stepper.h>
#include "OneButton.h"
#define PIN_INPUT 2
OneButton button(PIN_INPUT, true);
void setup() {
button.attachDuringLongPress(DuringLongPress, &button);
button.setPressMs(10);
button.setLongPressIntervalMs(500);
Serial.begin(9600);
}
void loop() {
button.tick();
delay(10);
}
void DuringLongPress(void *oneButton)
{
Serial.print(((OneButton *)oneButton)->getPressedMs());
Serial.println("\t - DuringLongPress()");
}