#include <SwitchInput.h>
|
| EncoderUpDownButtons (pinid_t pinUp, pinid_t pinDown, EncoderCallbackFn callback, uint8_t speed=20) |
|
| EncoderUpDownButtons (pinid_t pinUp, pinid_t pinDown, EncoderListener *listener, uint8_t speed=20) |
|
| EncoderUpDownButtons (pinid_t pinUp, pinid_t pinDown, pinid_t pinBack, pinid_t pinNext, SwitchListener *passThrough, EncoderCallbackFn callback, uint8_t speed=20) |
|
| EncoderUpDownButtons (pinid_t pinUp, pinid_t pinDown, pinid_t pinBack, pinid_t pinNext, SwitchListener *passThrough, EncoderListener *listener, uint8_t speed=20) |
|
void | onPressed (pinid_t pin, bool held) override |
|
void | onReleased (pinid_t pin, bool held) override |
|
| RotaryEncoder (EncoderCallbackFn callback) |
|
| RotaryEncoder (EncoderListener *listener) |
|
void | changePrecision (uint16_t maxValue, int currentValue, bool rolloverOnMax=false, int step=1) |
|
void | replaceCallback (EncoderCallbackFn callbackFn) |
|
void | replaceCallbackListener (EncoderListener *callbackFn) |
|
int | getCurrentReading () const |
|
void | setCurrentReading (int reading) |
|
void | increment (int8_t incVal) |
|
virtual void | encoderChanged () |
|
bool | didLastSyncSucceed () |
|
void | setUserIntention (EncoderUserIntention intention) |
|
EncoderUserIntention | getUserIntention () |
|
void | runCallback (int newVal) |
|
bsize_t | getMaximumValue () |
|
|
pinid_t | getIncrementPin () |
|
pinid_t | getDecrementPin () |
|
pinid_t | getBackPin () |
|
pinid_t | getNextPin () |
|
|
enum | EncoderFlagBits { LAST_SYNC_STATUS =0
, WRAP_AROUND_MODE
, OO_LISTENER_CALLBACK
, LAST_ENCODER_DIRECTION_UP
} |
|
uint16_t | maximumValue |
|
uint16_t | currentReading |
|
uint8_t | stepSize |
|
union { |
EncoderCallbackFn | callback |
|
EncoderListener * | encoderListener |
|
} | notify |
|
uint8_t | flags |
|
EncoderUserIntention | intent |
|
An emulation of a rotary encoder using switches for up and down.
- See also
- setupUpDownButtonEncoder
◆ EncoderUpDownButtons() [1/4]
EncoderUpDownButtons::EncoderUpDownButtons |
( |
pinid_t |
pinUp, |
|
|
pinid_t |
pinDown, |
|
|
EncoderCallbackFn |
callback, |
|
|
uint8_t |
speed = 20 |
|
) |
| |
Create an up down encoder based on two buttons, for up and down. This is a helper that wraps calls to switches and handles the up and down events. This version takes a function callback for change notification.
- Parameters
-
pinUp | the pin to use for up |
pinDown | the pin to use for down |
callback | the function callback when the encoder changes |
speed | the speed of repeat functions on the keys |
◆ EncoderUpDownButtons() [2/4]
EncoderUpDownButtons::EncoderUpDownButtons |
( |
pinid_t |
pinUp, |
|
|
pinid_t |
pinDown, |
|
|
EncoderListener * |
listener, |
|
|
uint8_t |
speed = 20 |
|
) |
| |
Create an up down encoder based on two buttons, for up and down. This is a helper that wraps calls to switches and handles the up and down events. This version takes an OO listener for change notification.
- Parameters
-
pinUp | the pin to use for up |
pinDown | the pin to use for down |
callback | the function callback when the encoder changes |
speed | the speed of repeat functions on the keys |
◆ EncoderUpDownButtons() [3/4]
EncoderUpDownButtons::EncoderUpDownButtons |
( |
pinid_t |
pinUp, |
|
|
pinid_t |
pinDown, |
|
|
pinid_t |
pinBack, |
|
|
pinid_t |
pinNext, |
|
|
SwitchListener * |
passThrough, |
|
|
EncoderCallbackFn |
callback, |
|
|
uint8_t |
speed = 20 |
|
) |
| |
Create an up down encoder based on two buttons, for up and down. This is a helper that wraps calls to switches and handles the up and down events. This version takes a function callback for change notification. Next and back are passed through to the passthrough callback so you can processes these commands. Calling the rotate meaning turns the encoder so that next and back function as up and down instead of the regular function keys. However, for the passthrough callback the original next and back pin numbers are sent, so outside of the encoder, no extra logic is needed.
- Parameters
-
pinUp | the pin to use for up |
pinDown | the pin to use for down |
pinBack | the pin to use for back |
pinNext | the pin to use for next |
passThrough | the passthrough listener on which this class will convey next and back key presses |
callback | the function callback when the encoder changes |
speed | the speed of repeat functions on the keys |
◆ EncoderUpDownButtons() [4/4]
EncoderUpDownButtons::EncoderUpDownButtons |
( |
pinid_t |
pinUp, |
|
|
pinid_t |
pinDown, |
|
|
pinid_t |
pinBack, |
|
|
pinid_t |
pinNext, |
|
|
SwitchListener * |
passThrough, |
|
|
EncoderListener * |
listener, |
|
|
uint8_t |
speed = 20 |
|
) |
| |
Create an up down encoder based on four buttons, for up and down. This is a helper that wraps calls to switches and handles the up and down events. This version takes an OO listener for change notification. The next and back are passed through to the passthrough callback so you can processes these commands. Calling the rotate meaning turns the encoder so that next and back function as up and down instead of the regular function keys. However, for the passthrough callback the original next and back pin numbers are sent, so outside of the encoder, no extra logic is needed.
- Parameters
-
pinUp | the pin to use for up |
pinDown | the pin to use for down |
pinBack | the pin to use for back |
pinNext | the pin to use for next |
passThrough | the passthrough listener on which this class will convey next and back key presses |
listener | the OO interface implementation for when encoder changes |
speed | the speed of repeat functions on the keys |
◆ onPressed()
void EncoderUpDownButtons::onPressed |
( |
pinid_t |
pin, |
|
|
bool |
held |
|
) |
| |
|
overridevirtual |
called when a key is pressed or held down
- Parameters
-
pin | the pin number |
held | true if held down |
Implements SwitchListener.
◆ onReleased()
void EncoderUpDownButtons::onReleased |
( |
pinid_t |
pin, |
|
|
bool |
held |
|
) |
| |
|
overridevirtual |
called when a key is released
- Parameters
-
pin | the key number |
held | true if key was held down |
Implements SwitchListener.
The documentation for this class was generated from the following files: