Arduino Universal Inputs
A collection of libraries for managing/processing input devices on Arduino.
|
Represents a two state button. More...
#include <IButton.h>
Public Member Functions | |
IButton (inputid_t id, inputtime_t debounceDelay=50) | |
Creates a new button. More... | |
inputtype_t | type () const |
Retrieves the type of this device. More... | |
bool | setDebounceDelay (inputtime_t debounce) |
Sets the debounce delay time. More... | |
inputtime_t | getDebounceDelay () const |
Gets the current debounce delay time. More... | |
bool | poll () |
Polls this input device for change. More... | |
bool | isActive () const |
Determines if the button is currently active. More... | |
inputtime_t | lastStateChange () const |
Returns the time of the last state change. More... | |
inputtime_t | lastActiveDuration () const |
Returns the duration for which the button was last active. More... | |
![]() | |
IInputDevice (inputid_t id) | |
Creates a new input device. More... | |
inputid_t | getID () const |
Retrieves the ID of this device. More... | |
Protected Member Functions | |
virtual uint8_t | getPhysicalState () const =0 |
Gets the current physical state of the button. More... | |
Represents a two state button.
IButton::IButton | ( | inputid_t | id, |
inputtime_t | debounceDelay = 50 |
||
) |
Creates a new button.
id | ID of the button |
debounceDelay | Debounce delay time in ms |
|
inline |
Gets the current debounce delay time.
|
protectedpure virtual |
Gets the current physical state of the button.
Implemented in ArduinoButton, and ArduinoMatrixButton.
|
inline |
Determines if the button is currently active.
|
inline |
Returns the duration for which the button was last active.
|
inline |
Returns the time of the last state change.
|
virtual |
Polls this input device for change.
Implements IInputDevice.
bool IButton::setDebounceDelay | ( | inputtime_t | debounce | ) |
Sets the debounce delay time.
debounce | Debounce delay time in ms |
|
inlinevirtual |