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

Public Member Functions

 Button (uint16_t value, void(*clickFunction)(void)=0, void(*holdFunction)(void)=0, uint16_t holdDuration=1000, uint16_t holdInterval=250)
 
void pressed ()
 
void held ()
 

Friends

class AnalogButtons
 

Constructor & Destructor Documentation

◆ Button()

Button::Button ( uint16_t  value,
void(*)(void)  clickFunction = 0,
void(*)(void)  holdFunction = 0,
uint16_t  holdDuration = 1000,
uint16_t  holdInterval = 250 
)

Creates an instance representing a single button.

Parameters
valueis the ADC value associated to the voltage reading for this button, will be combined with the margin value
clickFunctionis a reference to the function executed upon button click
holdFunctionis a reference to the executed upon button hold
holdDurationdetermines the number of milliseconds the button must remain pressed before being identified as held down (defaults to 1 second)
holdIntervaldetermines the number of milliseconds between each activation of the hold function while the button is kept pressed (defaults to 250 milliseconds)

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