#include <Arduino.h>
#include "RotaryEncoder.h"
RotaryEncoder encoder(32, 33, 100, 0, 1000);
const char* directions[] = {
"ccw", "", "cw"
};
void setup() {
Serial.begin(115200);
Serial.println("Hello, ESP32!");
encoder.begin();
}
void loop() {
if (encoder.available()) {
Serial.printf("%d (%s)\r\n",encoder.getPosition(), directions[encoder.getDirection()+1]);
}
delay(10); // this speeds up the simulation
}