Encoder
Encoder copied to clipboard
Initialization
Be sure to turn on the internal pull-up resistors as required by some encoders. This needs to be added after initializing the encoder object.
encoder.begin();
digitalWrite(2, HIGH); // turn on pullup resistors
digitalWrite(3, HIGH); // turn on pullup resistors