17 template <
typename Button>
116 inline uint8_t
id()
const {
135 template <
typename Button>
150 void(*callbackFn)(
enum Button::CALLBACK_EVENT, uint8_t) = 0,
152 :
Button(pin, callbackFn, id) {}
171 if(this->lastEvent_ == Button::RELEASED_EVENT) {
172 switch(
Button::clicks(Button::BUTTON_PRESSED, Button::BUTTON_RELEASED)){
174 doCallback(Button::SINGLE_CLICKED_EVENT);
178 doCallback(Button::DOUBLE_CLICKED_EVENT);
uint8_t currState_
The reading of the pin.
static uint8_t nextId()
Return the next auto-assigned button identifier.
int clicks(uint8_t pressed, uint8_t released)
Return the number of clicks.