15 auto res = longPressState == LongPress ? ReleasedLong : ReleasedShort;
16 longPressState = Initial;
18 }
else if (
incrState == Button::Falling) {
19 return IncrementShort;
22 if (longPressState == LongPress) {
30 longPressState = LongPress;
31 longPressRepeat =
now;
#define BEGIN_AH_NAMESPACE
A class that reads and filters an analog input.
bool update()
Read the analog input value, apply the mapping function, and update the average.
constexpr unsigned long LONG_PRESS_REPEAT_DELAY
The time between increments/decremnets during a long press.
constexpr unsigned long LONG_PRESS_DELAY
The time in milliseconds before a press is registered as a long press.