Debounce a boolean reading.
More...
#include <Debounce.h>
Debounce a boolean reading.
Debounce a boolean reading which is read at regular intervals. Additionally, provide edge detection functionalities.
Enumerator |
---|
FALLING |
The state has transitioned from high to low.
|
NONE |
The state has remained the same.
|
RISING |
The state has transitioned from low to high.
|
Debounce::Debounce |
( |
unsigned int |
interval | ) |
|
Debounce::Debounce |
( |
const Settings & |
settings | ) |
|
void Debounce::setup |
( |
unsigned int |
interval | ) |
|
Set up the debouncer and reset the internal state.
- Parameters
-
debounce | the number of calls to process() during which changes are ignored after a change in the input vaulue has been detected. |
void Debounce::setup |
( |
const Settings & |
settings | ) |
|
Set up the debouncer and reset the internal state.
- Parameters
-
settings | the number of calls to process() during which changes are ignored after a change in the input vaulue has been detected. |
bool Debounce::process |
( |
bool |
input | ) |
|
|
inline |
Process an input through the debouncer and obtain an output.
Get the current debounced state.
Edge Debounce::edgeDetected |
( |
| ) |
|
|
inline |
Return what edge was detected during the previous call to process()
static Edge Debounce::detectEdge |
( |
bool |
oldState, |
|
|
bool |
newState |
|
) |
| |
|
inlinestatic |
Detect what edge occurs between two values.
The documentation for this class was generated from the following files:
- libraries/Debounce/Debounce.h
- libraries/Debounce/Debounce.cpp