So my bicycle wheel rotates 3150 times in 1 mile. I want to build a mileometer that shows distance to an accuracy of 0.01 miles.
I get one pulse from a sensor on my wheel every time it rotates one revolution.
So I need to increment my display every 31.5 pulses.
I want to offload the counting to an 8-bit AVR counter to minimise my CPU load - it's a clever mileometer that does loads of other things as well !
I can't set the counter to 224 or 225, let the pulses increment the counter, detect the overflow, increment my display by 0.01, reset the counter and start again, because either value won't show exactly 1.00 on the display after exactly one mile.
So what do I do?
Answers on a Christmas post card please!
Best Regards, Martin