9#ifndef INPUT_EVENT_PJRC_ENCODER_ADAPTER_H
10#define INPUT_EVENT_PJRC_ENCODER_ADAPTER_H
15#include <EncoderAdapter/IEncoderAdapter.h>
58 encoder =
new Encoder(pinA, pinB);
71 return encoder->read();
A lightweight adapter abstract class for encoders.
Definition: IEncoderAdapter.h:19
An adapter for PJRC's Encoder.
Definition: PjrcEncoderAdapter.h:26
~PjrcEncoderAdapter()
Destructor to ensure the PJRC encoder is deleted.
Definition: PjrcEncoderAdapter.h:46
void setPosition(int32_t pos)
Set the a new position of the encoder. This can be any value in the int32_t range.
Definition: PjrcEncoderAdapter.h:79
PjrcEncoderAdapter(uint8_t encoderPin1, uint8_t encoderPin2)
Construct a new Pjrc Encoder Adapter object. An Encoder instance will be created for you.
Definition: PjrcEncoderAdapter.h:36
int32_t getPosition(void)
Get the current position as reported by the Encoder class.
Definition: PjrcEncoderAdapter.h:70
bool begin(void)
In Encoder < v1.4.4 begin is not used but when v1.4.5 is released we will use it to initialise the en...
Definition: PjrcEncoderAdapter.h:57