Go to the documentation of this file. 1 #ifndef ROTARYENCODER_h
2 #define ROTARYENCODER_h
17 volatile int _state[2];
18 volatile int _position;
20 volatile bool _inputFlag =
false;
21 bool _changeFlag =
false;
23 unsigned long _previousTimer;
29 int movements[5][4][4] = {
62 void _setState(
int a,
int b);
66 void _incrementPosition(
int delta);
70 int _findChange(
int state1[2],
volatile int state2[2]);
74 boolean _compareArrays(
int a[4],
int b[4]);
85 RotaryEncoder(
int pinA,
int pinB,
int id = 99) : _pinA(pinA), _pinB(pinB), _id(id)
87 pinMode(_pinA, INPUT_PULLUP);
88 pinMode(_pinB, INPUT_PULLUP);
90 _previousTimer = millis();
91 _setState(digitalRead(_pinA), digitalRead(_pinB));
void ICACHE_RAM_ATTR tick()
static const uint8_t kEventUnstableUpdate
Definition: RotaryEncoder.hpp:81
void setEventHandler(void(*function)(RotaryEncoder *, uint8_t, int))
What does this do?
static const uint8_t kEventStableUpdate
Definition: RotaryEncoder.hpp:80
void initInterrupts(void(*function)())
What does this do?
Definition: RotaryEncoder.hpp:9
void setPosition(int value)
What does this do?
RotaryEncoder(int pinA, int pinB, int id=99)
Definition: RotaryEncoder.hpp:85
void check()
What does this do?
int getId()
What does this do?
int getPostition()
What does this do?