
I am trying to decode the magnetic heading that is contained in a 10bit field. I am not sure how the above instructions are interpreted. What i did is just took the 10 bits and convert them to decimal like this
int magneticheading = Convert.ToInt32(olotoMEbinary.Substring(14, 10), 2);
But then i checked that 259degrees only need 9bits to be expressed in binary (100000011). I am confused about what does a most significant bit of 180 degrees mean and a lsb of 360/1 024 .
For example if i receive the following 10bits 0100001010 how are they converted to degrees according to the above instructions?
Using floating-point math, multiply by 360 and divide by 1024.