26 pinMode(LED_BUILTIN, OUTPUT);
45 if(event == Button::SINGLE_CLICKED_EVENT) {
47 digitalWrite(LED_BUILTIN,
led);
48 }
else if(event == Button::DOUBLE_CLICKED_EVENT) {
50 digitalWrite(LED_BUILTIN,
led);
void setup()
Setup the ClickedBtn example.
Button btn(BUTTON_PIN, clickedCallback)
The button to check.
void clickedCallback(Button::CALLBACK_EVENT, uint8_t)
Callback function for button released.
#define BUTTON_PIN
Connect button between this pin and ground.
bool led
On/off state of the LED.
void loop()
Control the ClickedBtn example.