3 ms·
>poll the pins in the loop You should be using interrupts for encoders. The standard Encoder library uses interrupts. https://www.arduino.cc/reference/en/libr
by brokenmachine 3y ago
>poll the pins in the loop
You should be using interrupts for encoders. The standard Encoder library uses interrupts.
https://www.arduino.cc/reference/en/libraries/encoder/ https://www.arduino.cc/reference/en/libraries/encoder/
In my experience on an ESP8266, it can do over 300kHz. Probably faster on an ESP32. For ESP8266, just remember to set ICACHE_RAM_ATTR for the ISR. Not sure if ESP32 is the same, but it probably is.
So you'd need to be turning those encoders pretty damn fast for the interrupt speed to become a problem.