@Bob_Schor wrote:
So count edges..
... and if we are lucky and the ticks per revolution is an integer power of two, we could just use a counter with the correct number of bits and things will roll over automatically. No math or conditions required. 😉