Closed tacuna closed 2 years ago
This seem to work and gives plausible results
Ok(SensorData {
co2,
temperature: temperature as f32 * 175_f32 / 65536_f32 - 45_f32,
humidity: humidity as f32 * 100_f32 / 65536_f32,
})
Taken from https://github.com/Sensirion/raspberry-pi-i2c-scd4x/blob/master/scd4x_i2c.c
Looks good, I will change it in the next few days.
When running the example i get
Seems like temperature: '((((21875 * temperature) >> 13) - 45000) as f32) / 1000.0' is not safe.