![]() |
InputEvents v1.6.0
An easy to use but comprehensive Event Library for Buttons, Encoders, Encoder Buttons, Analog Inputs, Joysticks and Switches.
|
A lightweight adapter abstract class for encoders.
#include <IEncoderAdapter.h>

Public Member Functions | |
| virtual | ~IEncoderAdapter ()=default |
| Destructor to ensure predictable behavious if derived classes are destroyed. | |
| virtual bool | begin (void)=0 |
| For compatibility with the Arduino library convention. More... | |
| virtual int32_t | getPosition (void)=0 |
| Get the current position as reported by the encoder class. More... | |
| virtual void | setPosition (int32_t pos)=0 |
| Set the a new position of the encoder. For some libraries this may only allow it to be set to 0. More... | |
|
pure virtual |
For compatibility with the Arduino library convention.
Must be implemented (but can be empty) as some libraries require it. Can return a boolean to indicate if initialisation has failed.
Implemented in ExpanderEncoderAdapter, SlowExpanderEncoderAdapter, and PjrcEncoderAdapter.
|
pure virtual |
Get the current position as reported by the encoder class.
Implemented in BaseTableEncoderAdapter, SlowExpanderEncoderAdapter, and PjrcEncoderAdapter.
|
pure virtual |
Set the a new position of the encoder. For some libraries this may only allow it to be set to 0.
| pos | The desired new position. |
Implemented in BaseTableEncoderAdapter, PjrcEncoderAdapter, and SlowExpanderEncoderAdapter.