void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
union {
uint8_t b[4];
float f;
} data;
void loop() {
// put your main code here, to run repeatedly:
data.b[0]=0;
data.b[1]=1;
data.b[2]=2;
data.b[3]=3;
Serial.println(data.f);
}
If you are sure that the discrete 4-byte data that you own are the components of a float number, then I would recommend to choose the advice of Post#1. Assume, float x = 14.53; byte[0] = 0xE1, byte[1] = 0x7A, byte[2] = 0x86, byet[3] = 0x41. (Serial.print((long)&x, HEX); //shows: 41687AE1)