12 Debouncer(uint16_t timeoutMs = 5000,
void* ref =
nullptr) {
13 setDebounceTimeout(timeoutMs);
17 void setDebounceTimeout(uint16_t timeoutMs) {
22 bool debounce(
void(*cb)(
void* ref) =
nullptr) {
24 if (
millis() > debounce_ms) {
26 if (cb !=
nullptr) cb(p_ref);
28 debounce_ms =
millis() + ms;
38 unsigned long debounce_ms = 0;
40 void* p_ref =
nullptr;