Sunday, June 26, 2016

Info on number conversions - SUCCESS updated!

Update:   The m file from the Matlab file exchange works!!!
The function is hexsingle2num.h

Here's what I typed:
hexsingle2num('401c0000')
It returned the correct answer 2.4375

To test:  I believe the api frame sends the bytes as 00 00 1C 40

So, the bytes need to be switched to put it into the new function.


Here's a really good explanation by Jack Christensen - scroll down to his second entry.
http://forum.arduino.cc/index.php?topic=211723.0

Here's a good converter that gives the same values as the BNO055 sensor and the library and the use of the C union struct.
http://www.h-schmidt.net/FloatConverter/IEEE754.html


No comments:

Post a Comment