Encoder library on Teensy LC: lotsa noise?


Well-known member
I’m testing the encoder library using pins 23 and 21 on my Teensy LC. It responds but most of the time it interprets clockwise and counterclockwise rotation as a positive increment. As I read in a thread here, I added pull-up resistors but I see no improvement. These are really cheap encoders. I’m going to try another brand tomorrow.
But is there anything else I can try? Using the basic encoder example sketch with the pin numbers changed.

Oh yes one more thing: I tried a polling (not interrupt-driven library) and that works as designed.
Last edited:
Thanks! At the risk of going off topic, I will need to support 4 encoders and their push switches. Does anyone have a clever scheme to conserve Teensy pins? I’m using an analog multiplexer for my non-encoder knobs.
Okay, it was the hardware. Testing now with a different make of encoder and Paul's library (interrupt-driven) works great.
I have worked all the way through a project and the last major issue is with the EncorderTool library.
I am using the software multiplex.
What happens is, during use the encoders stop responding. The switch callbacks continue to work, but knob position updates are ignored.
After a while, the encoders will resume and I can use them.

I will take another look at the code, and if possible I will post some or all of the sketch.
This project uses a Teensy LC to monitor encoders and switches, and sends state changes to a Teeny 4.0 which is a sound generator.
... so I will send over the LC sketch, where I see in my serial monitor the encoders become unresponsive.
Sorry, I have not had time to do this yet. I did spend time checking the signal paths and cleaning the build. Much improvement.