Example on/off button via callback functions. More...
#include <AbleButtons.h>
Go to the source code of this file.
Macros | |
#define | BUTTON_PIN 2 |
Connect button between this pin and ground. More... | |
Typedefs | |
using | Button = AblePullupCallbackButton |
Using callback pull-up button. More... | |
using | ButtonList = AblePullupCallbackButtonList |
Using callback pull-up button list. More... | |
Functions | |
void | buttonableCallback (Button::CALLBACK_EVENT event, uint8_t id) |
Callback function for button events. More... | |
void | setup () |
Setup the ButtonableCallback example. More... | |
void | loop () |
Control the ButtonableCallback example. More... | |
Variables | |
Button | btn (BUTTON_PIN, buttonableCallback) |
The button to check. | |
Example on/off button via callback functions.
Similar to Buttonable example, but uses on-pressed and on-released callback functions to control the built-in LED.
Definition in file ButtonableCallback.ino.
#define BUTTON_PIN 2 |
Connect button between this pin and ground.
Definition at line 17 of file ButtonableCallback.ino.
using Button = AblePullupCallbackButton |
Using callback pull-up button.
Definition at line 11 of file ButtonableCallback.ino.
Using callback pull-up button list.
Definition at line 12 of file ButtonableCallback.ino.
void buttonableCallback | ( | Button::CALLBACK_EVENT | event, |
uint8_t | id | ||
) |
Callback function for button events.
event | The event that has occured. |
id | The identifier of the button generating the callback (unused in this example). |
Definition at line 42 of file ButtonableCallback.ino.
void loop | ( | ) |
Control the ButtonableCallback example.
Called repeatedly in a loop.
Definition at line 31 of file ButtonableCallback.ino.
void setup | ( | ) |
Setup the ButtonableCallback example.
Called once to initialise everything.
Definition at line 23 of file ButtonableCallback.ino.