I know this subject has been raised a number of times, but I haven't found anything appropriate, or perhaps I'm not phrasing the search correctly.
I have an Atmega324PB (@20Mhz from external clock) with 16 encoders attached. Code uses PCINT to capture rotation and it works well with reliable accuracy (don't miss any increments). Hardware debounce is in use. Board is designed for 2 humans turning the knobs so working on only 4 changing at any one time.
Positions are relayed to remote device using TWI.
My conundrum is how can I determine speed of rotation so that if an encoder is turned rapidly I can increment position in 10's. Testing shows that I can move a max of ~9 detents with a quick flick.
Any ideas? Timer perhaps, but I can't fathom how that might work. I would rather the board manage the speed increase in incremental values rather than the remote end figuring it out.
Any pointers would be appreciated