arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Debouncer Class Reference

Helper class to debounce user input from a push button. More...

#include <Debouncer.h>

Public Member Functions

 Debouncer (uint16_t timeoutMs=5000, void *ref=nullptr)
 
bool debounce (void(*cb)(void *ref)=nullptr)
 Prevents that the same method is executed multiple times within the indicated time limit.
 
void setDebounceTimeout (uint16_t timeoutMs)
 

Protected Attributes

unsigned long debounce_ms = 0
 
uint16_t ms
 
voidp_ref = nullptr
 

Detailed Description

Helper class to debounce user input from a push button.

Constructor & Destructor Documentation

◆ Debouncer()

Debouncer ( uint16_t  timeoutMs = 5000,
void ref = nullptr 
)
inline

Member Function Documentation

◆ debounce()

bool debounce ( void(*)(void *ref)  cb = nullptr)
inline

Prevents that the same method is executed multiple times within the indicated time limit.

◆ setDebounceTimeout()

void setDebounceTimeout ( uint16_t  timeoutMs)
inline

Member Data Documentation

◆ debounce_ms

unsigned long debounce_ms = 0
protected

◆ ms

uint16_t ms
protected

◆ p_ref

void* p_ref = nullptr
protected

The documentation for this class was generated from the following file: