#include <RotaryEncoder.h>
RotaryEncoder encoder(12, 14, RotaryEncoder::LatchMode::TWO03);

  void Ae_encoderInterrupt() {
    
    encoder.tick(); // Оновлення стану енкодера
    
   
  }

void setup() {
  
  pinMode(32, INPUT_PULLUP);
  
  
  Serial.begin(9600);
  
  attachInterrupt(digitalPinToInterrupt(12), Ae_encoderInterrupt, CHANGE);
  attachInterrupt(digitalPinToInterrupt(14), Ae_encoderInterrupt, CHANGE);

}

void loop() {
         
        Serial.println(encoder.getPosition());
        

}