Page 1 of 1

Convert from hex to float

Posted: 13 Sep 2021 10:02
by tnesheim
Hi
I have a sensor where I read four bytes. I have managed to put these values into a dword which is:

0x440B66C9

And now need to transform this hex-value into some readable. Using an online hex->float calculator I see that this hex-value correspond to:

557.606

But how do I get there in the z-uno? I have searched and tried several code suggestions but haven't succeeded. Any suggestions?

Re: Convert from hex to float

Posted: 13 Sep 2021 14:32
by tnesheim
I can probably also do with the two most significant bytes:

0x440B

that corresponds to

556

which have enough accuracy.