How is the encoder wired? Maybe you need to use pinMode(pin,INPUT_PULLUP) or a debounce library, or (last resort) interrupts.
https://www.pjrc.com/teensy/td_libs_Encoder.html
How is the encoder wired? Maybe you need to use pinMode(pin,INPUT_PULLUP) or a debounce library, or (last resort) interrupts.
https://www.pjrc.com/teensy/td_libs_Encoder.html