How accurate can I count on the trigger timing of ISRs registered with RegisterRepeatingTimer() to be?
I have the idea of using a repeating timer to do regular velocity calculations on the two quad encoders attached to my gear boxes. Basically the ISR would read the encoder counts, subtract the previous counts from each to get the differences, and divide by the repeating timer interval (most likely 256ms, so I can divide using bit shifting). The resulting velocities would be stored in global variables to be accessed by my PID code running in the “default” loop.
Will this work?