Sensirion SPS30 particle sensor

The particle dust sensor from Sensirion is a beautifull sensor. The built in software is verry complicated.
The Github libraries are difficult to get working. So i decided to use the I2C connection and program it my self.
With some nice help it is working beautifully. The results seem to be OK.
The format of the output is 4 heaxadecimal characters representing the IEEE754 floating point value.

With an IEEE745 converter correct values can be calculated:

https://www.h-schmidt.net/FloatConverter/IEEE754.html

my result: 0x40588CE4 gives a float value of 3.3835992 wich seems to be a correct value.

The conversion exists of replacing the 4 hex bytes at the place of the float. At the internet i found lots of programs to do this exchange. But these programs don't function with my Arduino's I used the UNO and the ESP32, both give the same result. Always 0.00

Can anybody find the error in my code?

hex_to_float.ino (283 Bytes)

the software did not open in my computer, so i include the software in this post:

// conversie hex naar float

float snelheid;

void setup() {
Serial.begin(115200);
}

void loop() {

union u_tag {
byte b[4];
float fval;
} u;

u.b[0] = 0x40;
u.b[1] = 0x35;
u.b[2] = 0xA7;
u.b[3] = 0x81;

snelheid = u.fval;

Serial.println(snelheid);
delay(10000);
}