Hi, the camera interrupts the processor per line of data coming in. In general, there are too many interrupts on the system to do a good job like an Arduino monitoring interrupts. If the encoder is a low resolution one and updates slowly then this is okay. However, realistically the processor can’t be trusted to have super real-time performance for anything that doesn’t have hardware pheripals to montitor.
This all said… the timers on the STM32 have the ability to do encoder logic in hardware and can do quadrature encoding. However, I don’t know how to use this from the python interface. But, if you want to figure it out the microcontroller can definitely do it.