InputEvents v1.4.0
An easy to use but comprehensive Event Library for Buttons, Encoders, Encoder Buttons, Analog Inputs, Joysticks and Switches.
Public Member Functions | List of all members
FoltmanDebounceAdapter Class Reference

Description

This is the default InputEvents debouncer. Many thanks to @kfoltman.

#include <FoltmanDebounceAdapter.h>

Inheritance diagram for FoltmanDebounceAdapter:
Inheritance graph
[legend]

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...
 
- Public Member Functions inherited from DebounceAdapter
 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

- Protected Attributes inherited from DebounceAdapter
PinAdapterpinAdapter
 
uint16_t debounceInterval = 10
 

Member Function Documentation

◆ begin()

void FoltmanDebounceAdapter::begin ( )
inlinevirtual

Initialise the debouncer and pin adapter. Must be safe for repeated calls (Idempotent)

Reimplemented from DebounceAdapter.

◆ read()

bool FoltmanDebounceAdapter::read ( )
inlineoverridevirtual

Return the debounced state of the pin adapter.

Returns
true/HIGH
false/LOW

Implements DebounceAdapter.


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