08-22-2011 01:55 AM
I need to convert an angle from degrees to a 14 bit BCD format. i.e. 0 degrees all 0's, 359.99 degrees all 1's. What is the best way to go about this?
Solved! Go to Solution.
08-22-2011 02:12 AM
Hi venturer,
angle(BCD14) = convert-to-u16( remainder( angle(degree) / 360 ) * 16384 )
Simple math, isn't it?
Btw.
This isn't called BCD. It's just a different number range (0-16383) for the same meaning (0-359.99°)...
08-22-2011 02:39 AM
one small correction: you have to divide by 360 once: