tcMenu
Public Member Functions | List of all members
TwoButtonSwitchEncoder Class Reference

#include <TwoButtonSwitchEncoder.h>

Inheritance diagram for TwoButtonSwitchEncoder:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TwoButtonSwitchEncoder()

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.

Parameters
upthe up button (doubles as back when held)
downthe down button (doubles as OK when held)
callbackFnthe encoder change callback.

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