Fix si7021 temperature/humidity sensor reading

Raw reading modified according to the Silicon Labs sample code for the Si7021 sensor
This commit is contained in:
David Dix 2019-11-29 08:38:51 +00:00 committed by GitHub
parent 53fa634908
commit 6d755943e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,6 +139,9 @@ static inline int16_t dht_convert_data(dht_sensor_type_t sensor_type, uint8_t ms
data = 0 - data; // convert it to negative
}
}
else if (sensor_type == DHT_TYPE_SI7021) {
data = msb * 256 + (lsb & ~0x3);
}
else {
data = msb * 10;
}