Hi Ingvar, hope you enjoyed the beers.
I sure did, again and again and again and ..... i just hated myself the day after.
I do have a quick question, as I'm running the 15bit or less code currently so my accuracy is to +- 1 FPS (last digit).
Can DIV32 give a remainder so rounding can be used ? Like //.
You can increase the resolution by 10 quite easy. Just preload the registers with 120000000dec(=07270E00hex) instead. You could then do rounding on that.
Code:
R0.HIGHBYTE = $07
R0.LOWBYTE = $27
R2.HIGHBYTE = $0E
R2.LOWBYTE = $00
Velocity = DIV32 Raw
Velocity = (velocity + 5 )/10
Just remember that the accuracy decreases with higher speeds. Not much use for tenths of ft/s when the raw data can't be more accurate than 3 ft/s.
Raw = 2000 gives 6000 ft/s
Raw = 2001 gives 5997 ft/s
/Ingvar
Bookmarks