Hello everyone,
I've been trying to get the direction of my rotary encoder and print it in the serial monitor using the RotaryEncoder.h library and this code:
Thank you for your answer
By using this instruction I don't get any error anymore! But if I want to print the value on the monitor I get the error: " no matching function for call to 'HardwareSerial::println(RotaryEncoder::Direction&)' ".
If I try to put
if(dir==1)
{Serial.println("ok")}
I get the error: "no match for 'operator==' (operand types are 'RotaryEncoder::Direction' and 'int')"
So what I think it means is that the output of "dir" can't be compared with an int number since it's a library own "variable type". Can't I get a direction variable that is an int or some other Arduino language type variable? Hope I haven't made any stupid error