Arduino Universal Inputs
A collection of libraries for managing/processing input devices on Arduino.
|
Represents a button on an Arduino pin. More...
#include <ArduinoButton.h>
Public Member Functions | |
ArduinoButton (inputid_t id, inputpin_t pin, bool activeLow=true, bool pullUp=true) | |
Creates a new button on an Arduino pin. More... | |
inputpin_t | getPin () const |
Gets the pin the button is attached to. More... | |
bool | isActiveLow () const |
Determines if the pin logic is active low. More... | |
bool | isPullUp () const |
Determines if the pin is pulled high. More... | |
![]() | |
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 | |
uint8_t | getPhysicalState () const |
Gets the current physical state of the button. More... | |
Represents a button on an Arduino pin.
ArduinoButton::ArduinoButton | ( | inputid_t | id, |
inputpin_t | pin, | ||
bool | activeLow = true , |
||
bool | pullUp = true |
||
) |
Creates a new button on an Arduino pin.
id | ID of the button |
pin | Pin the button is attached to |
activeLow | If the button logic is active low |
pullUp | If the pin should be pulled high |
|
protectedvirtual |
Gets the current physical state of the button.
Implements IButton.
|
inline |
Gets the pin the button is attached to.
|
inline |
Determines if the pin logic is active low.
|
inline |
Determines if the pin is pulled high.