AceButton
1.3.3
An adjustable, compact, event-driven button library for Arduino.
|
A subclass of ButtonConfig which allows the user to override the varous timing parameters of ButtonConfig at runtime. More...
#include <AdjustableButtonConfig.h>
Additional Inherited Members | |
Public Types inherited from ace_button::ButtonConfig | |
typedef uint16_t | FeatureFlagType |
Type of the feature flag. More... | |
typedef void(* | EventHandler) (AceButton *button, uint8_t eventType, uint8_t buttonState) |
The event handler signature. More... | |
Public Member Functions inherited from ace_button::ButtonConfig | |
ButtonConfig () | |
Constructor. More... | |
uint16_t | getDebounceDelay () |
Milliseconds to wait for debouncing. More... | |
uint16_t | getClickDelay () |
Milliseconds to wait for a possible click. More... | |
uint16_t | getDoubleClickDelay () |
Milliseconds between the first and second click to register as a double-click. | |
uint16_t | getLongPressDelay () |
Milliseconds for a long press event. More... | |
uint16_t | getRepeatPressDelay () |
Milliseconds that a button needs to be Pressed down before the start of the sequence of RepeatPressed events. More... | |
uint16_t | getRepeatPressInterval () |
Milliseconds between two successive RepeatPressed events. | |
void | setDebounceDelay (uint16_t debounceDelay) |
Set the debounceDelay. More... | |
void | setClickDelay (uint16_t clickDelay) |
Set the clickDelay. More... | |
void | setDoubleClickDelay (uint16_t doubleClickDelay) |
Set the doubleClickDelay. More... | |
void | setLongPressDelay (uint16_t longPressDelay) |
Set the longPressDelay. More... | |
void | setRepeatPressDelay (uint16_t repeatPressDelay) |
Set the repeatPressDelay. More... | |
void | setRepeatPressInterval (uint16_t repeatPressInterval) |
Set the repeatPressInterval. More... | |
virtual unsigned long | getClock () |
Return the milliseconds of the internal clock. More... | |
virtual unsigned long | getClockMicros () |
Return the microseconds of the internal clock. More... | |
virtual int | readButton (uint8_t pin) |
Return the HIGH or LOW state of the button. More... | |
bool | isFeature (FeatureFlagType features) ACE_BUTTON_INLINE |
Check if the given features are enabled. More... | |
void | setFeature (FeatureFlagType features) ACE_BUTTON_INLINE |
Enable the given features. More... | |
void | clearFeature (FeatureFlagType features) ACE_BUTTON_INLINE |
Disable the given features. More... | |
EventHandler | getEventHandler () ACE_BUTTON_INLINE |
Return the eventHandler. More... | |
void | setEventHandler (EventHandler eventHandler) ACE_BUTTON_INLINE |
Install the event handler. More... | |
void | setTimingStats (TimingStats *timingStats) |
Set the timing stats object. More... | |
TimingStats * | getTimingStats () |
Get the timing stats. More... | |
Static Public Member Functions inherited from ace_button::ButtonConfig | |
static ButtonConfig * | getSystemButtonConfig () ACE_BUTTON_INLINE |
Return a pointer to the singleton instance of the ButtonConfig which is attached to all AceButton instances by default. | |
Static Public Attributes inherited from ace_button::ButtonConfig | |
static const uint16_t | kDebounceDelay = 20 |
Default value returned by getDebounceDelay(). More... | |
static const uint16_t | kClickDelay = 200 |
Default value returned by getClickDelay(). More... | |
static const uint16_t | kDoubleClickDelay = 400 |
Default value returned by getDoubleClickDelay(). More... | |
static const uint16_t | kLongPressDelay = 1000 |
Default value returned by getLongPressDelay(). More... | |
static const uint16_t | kRepeatPressDelay = 1000 |
Default value returned by getRepeatPressDelay(). More... | |
static const uint16_t | kRepeatPressInterval = 200 |
Default value returned by getRepeatPressInterval(). More... | |
static const FeatureFlagType | kFeatureClick = 0x01 |
Flag to activate the AceButton::kEventClicked event. More... | |
static const FeatureFlagType | kFeatureDoubleClick = 0x02 |
Flag to activate the AceButton::kEventDoubleClicked event. More... | |
static const FeatureFlagType | kFeatureLongPress = 0x04 |
Flag to activate the AceButton::kEventLongPress event. More... | |
static const FeatureFlagType | kFeatureRepeatPress = 0x08 |
Flag to activate the AceButton::kEventRepeatPressed event. More... | |
static const FeatureFlagType | kFeatureSuppressAfterClick = 0x10 |
Flag to suppress kEventReleased after a kEventClicked. More... | |
static const FeatureFlagType | kFeatureSuppressAfterDoubleClick = 0x20 |
Flag to suppress kEventReleased after a kEventDoubleClicked. More... | |
static const FeatureFlagType | kFeatureSuppressAfterLongPress = 0x40 |
Flag to suppress kEventReleased after a kEventLongPressed. More... | |
static const FeatureFlagType | kFeatureSuppressAfterRepeatPress = 0x80 |
Flag to suppress kEventReleased after a kEventRepeatPressed. More... | |
static const FeatureFlagType | kFeatureSuppressClickBeforeDoubleClick = 0x100 |
Flag to suppress kEventClicked before a kEventDoubleClicked. More... | |
static const FeatureFlagType | kFeatureSuppressAll |
Convenience flag to suppress all suppressions. More... | |
Protected Member Functions inherited from ace_button::ButtonConfig | |
virtual void | init () |
Initialize to its pristine state, except for the EventHandler which is unchanged. More... | |
A subclass of ButtonConfig which allows the user to override the varous timing parameters of ButtonConfig at runtime.
Each timing parameter is stored in a member variable, so an instance of AdjustableButtonConfig consumes far more static RAM than ButtonConfig. In return, this class allows these parameters to be changed at runtime by the user.
Warning: This class is deprecated and replaced with its parent ButtonConfig class. You can just use ButtonConfig everywhere you previously used AdjustableButtonConfig.
Definition at line 43 of file AdjustableButtonConfig.h.