![]() |
InputEvents v1.4.0
An easy to use but comprehensive Event Library for Buttons, Encoders, Encoder Buttons, Analog Inputs, Joysticks and Switches.
|
This is the default InputEvents debouncer. Many thanks to @kfoltman.
#include <FoltmanDebounceAdapter.h>
Public Member Functions | |
FoltmanDebounceAdapter (PinAdapter *pinAdapter) | |
void | begin () |
Initialise the debouncer and pin adapter. Must be safe for repeated calls (Idempotent) More... | |
bool | read () override |
Return the debounced state of the pin adapter. More... | |
![]() | |
DebounceAdapter (uint16_t debounceInterval=10) | |
DebounceAdapter (PinAdapter *pinAdapter, uint16_t debounceInterval=10) | |
void | begin () |
Initialise the debouncer and pin adapter. Must be safe for repeated calls (Idempotent) More... | |
virtual bool | read ()=0 |
Return the debounced state of the pin adapter. More... | |
void | setPinAdapter (PinAdapter *adapter) |
The pinAdapter is usually passed via the constructor. If it is not, it must be set before begin() is called. More... | |
virtual void | setDebounceInterval (uint16_t interval) |
Set the debounce interval. Default is 10ms. More... | |
virtual void | begin ()=0 |
Initialise the pin adapter. Must be safe for repeated calls (Idempotent) More... | |
virtual bool | read ()=0 |
Read the current state of the pin. More... | |
Additional Inherited Members | |
![]() | |
PinAdapter * | pinAdapter |
uint16_t | debounceInterval = 10 |
|
inlinevirtual |
Initialise the debouncer and pin adapter. Must be safe for repeated calls (Idempotent)
Reimplemented from DebounceAdapter.
|
inlineoverridevirtual |
Return the debounced state of the pin adapter.
Implements DebounceAdapter.