You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DHT_readTemperature for DHT21/DHT22 Temp sensor - wrong negative values, for negative values only, the first bit is not masked (for negative values & 0x7F) and returns temperature of -3276.7 instead of -0.1
possibly the conversion in src/driver/drv_dht_internal.c is not called from drive_dht.c with correct parameters:
`float DHT_readTemperature(dht_t *dht, bool S, bool force) {
float f = 0;
byte *data;
data = dht->data;
if (DHT_read(dht,force)) {
switch (dht->_type) {
.....
.....
case DHT22:
case DHT21:
f = ((unsigned short)(data[2] & 0x7F)) << 8 | data[3];
f *= 0.1;
if (data[2] & 0x80) {
f *= -1;
}
if (S) {
f = convertCtoF(f);
}
break;
}
}
return f;`
is not performed correctly
when calling this function?
I am observing this issue with
BK7231N
von Beken Corporation
Firmware: 1.17.104
and DHT21/DHT22 temperature sensor.
The text was updated successfully, but these errors were encountered:
DHT_readTemperature for DHT21/DHT22 Temp sensor - wrong negative values, for negative values only, the first bit is not masked (for negative values & 0x7F) and returns temperature of -3276.7 instead of -0.1
possibly the conversion in src/driver/drv_dht_internal.c is not called from drive_dht.c with correct parameters:
`float DHT_readTemperature(dht_t *dht, bool S, bool force) {
float f = 0;
byte *data;
data = dht->data;
is not performed correctly
when calling this function?
I am observing this issue with
BK7231N
von Beken Corporation
Firmware: 1.17.104
and DHT21/DHT22 temperature sensor.
The text was updated successfully, but these errors were encountered: