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.
◆ Edge
| 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() [1/2]
| Debounce::Debounce |
( |
unsigned int | interval | ) |
|
◆ Debounce() [2/2]
| Debounce::Debounce |
( |
const Settings & | settings | ) |
|
◆ setup() [1/2]
| 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. |
◆ setup() [2/2]
| 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. |
◆ process()
| bool Debounce::process |
( |
bool | input | ) |
|
|
inline |
Process an input through the debouncer and obtain an output.
◆ get()
Get the current debounced state.
◆ edgeDetected()
| Edge Debounce::edgeDetected |
( |
| ) |
|
|
inline |
Return what edge was detected during the previous call to process()
◆ detectEdge()
| 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