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
Class for reading 8 rotary encoders using a MCP23017 I²C port expander.
void update()
If the state of the MCP23017's GPIO changed, read the new state and update the encoder positions.
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.