-11.7 is a float.
When converted to binary it becomes:
11000001001110110011001100110011
This in hex is:
C1 3B 33 33
The float is sent in reverse, so you get:
33 33 3B C1
![]()
Interestingly, you can achieve the same thing with this:
typedef union {
float floatingPoint;
byte binary[4];
} binaryFloat;
void setup() {
// put your setup code here, to run once:
binaryFloat hi;
hi.floatingPoint = -11.7;
Serial.begin(115200);
Serial.write(hi.binary,4);
}
Unions a so cool! Basically the 'byte binary[4]' and 'float floatingPoint' are joined and share the same memory space, so you can access either, and if you change one, you change the other. You can have so much fun changing the byte array, and seeing what its floating point equivalent is ![]()