AnalogButtons
Arduino multi button support library
Public Member Functions | List of all members
AnalogButtons Class Reference

Public Member Functions

 AnalogButtons (uint8_t pin, uint8_t mode=INPUT, uint16_t debounce=5, uint8_t margin=10)
 
void add (Button button)
 
void check ()
 

Constructor & Destructor Documentation

◆ AnalogButtons()

AnalogButtons::AnalogButtons ( uint8_t  pin,
uint8_t  mode = INPUT,
uint16_t  debounce = 5,
uint8_t  margin = 10 
)

Creates the instance handling an analog pin to support multiple buttons.

Parameters
pinthe analog pin this instance will manage
modethe pin mode (defaults to INPUT)
debouncedetermines the minimum duration a button must remain pressed to be considered being clicked in order to avoid false positives (defaults to 5)
margintakes into account slight resistance fluctuations and ADC errors transforming the button value into a range (defaults to 10)

Member Function Documentation

◆ add()

void AnalogButtons::add ( Button  button)

Adds a button to this handler.

◆ check()

void AnalogButtons::check ( )

Must be executed perioodically in order to have the button functions activated accordingly to the button pressed.


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