How do you plan to solve it?
/*Paste your code here*/
#include "OneButton.h"
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
pinMode(6, OUTPUT);
OneButton button(6, true, true);
button.attachClick([]() {
Serial.println("Single Click Detected");
});
// Double Click
button.attachDoubleClick([]() {
Serial.println("Double Click Detected");
});
button.attachLongPressStart([]() {
Serial.println("Long Press Started");
});
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(LED_BUILTIN, LOW);
delay(1000); // Wait for 1000 millisecond(s)
button.tick();
}
Add a video of the output (know more)
