#include <RotaryEncoder.h>
RotaryEncoder encoder(26, 27, RotaryEncoder::LatchMode::FOUR3);
void Ae_encoderInterrupt() {
encoder.tick(); // Оновлення стану енкодера
}
void setup() {
pinMode(32, INPUT_PULLUP);
Serial.begin(9600);
attachInterrupt(digitalPinToInterrupt(26), Ae_encoderInterrupt, CHANGE);
attachInterrupt(digitalPinToInterrupt(27), Ae_encoderInterrupt, CHANGE);
}
void loop() {
Serial.println(encoder.getPosition());
}