#include <TwoButtonSwitchEncoder.h>
Public Member Functions | |
TwoButtonSwitchEncoder (pinid_t up, pinid_t down, EncoderCallbackFn callbackFn) | |
void | onPressed (pinid_t pin, bool held) override |
void | onReleased (pinid_t pin, bool held) override |
Use this class to control a menu application with only two buttons. The up/down buttons double up as back and select when held. This means that repeat operation is not possible, keep integer and choice value ranges small so as to avoid needing many presses.
TwoButtonSwitchEncoder::TwoButtonSwitchEncoder | ( | pinid_t | up, |
pinid_t | down, | ||
EncoderCallbackFn | callbackFn | ||
) |
Create a two button switch given an up and down button along with the callback function for the encoder.
up | the up button (doubles as back when held) |
down | the down button (doubles as OK when held) |
callbackFn | the encoder change callback. |