#include "CFRotaryEncoder.h" // Verwendung der Bibliothek
const int CLK = D6;
const int DT = D0;
const int SW = D5;
CFRotaryEncoder rotaryEncoder(CLK, DT, SW);
void setup() // Beginn des Setups
{
Serial.begin(9600);
rotaryEncoder.setAfterRotaryChangeValueCallback(rotaryAfterChangeValueCallback);
rotaryEncoder.setPushButtonOnPressCallback(rotaryOnPressCallback);
rotary.begin();
}
void loop(){
rotaryEncoder.loop();
}
void rotaryAfterChangeValueCallback() {
// Do something...
}
void rotaryOnPressCallback() {
// Do something...
}