
Originally Posted by
Joe S.
All this math makes my head hurt

, couldn't you do the math twice with different multipliers, throw out the top numbers from one, and the bottom numbers from the other and display the results together separated by the decimal point ? Or is that what you just said?
You could do what you suggested, but I split it up to display the math involved a bit more clearly...
If I was me as I usually am, I would've put something like this instead:
Code:
dummy=(position<<8)*90:result_high=div32 1024:degrees_whole = result_high >> 6
dummy=(position<<8)*9000:result_low=div32 1024:degrees_fraction=(result_low>>6)//100
lcdout $fe,1,"Degrees:",DEC3 degrees_whole,":",DEC2 degrees_fraction
Bookmarks