Closed argltuc closed 3 years ago
Looks good
uh, I forgott to ingrease version numbers in library.json and library.properties. sorry...
No problem, didn't notice either only after merging :)
I pushed a fix
0.4.5 released
Instead of setting temperature to 0, it should invert sign and 0x80 should be removed from _bits[2]
.
This works for me:
int16_t t = ((_bits[2] & 0x7F) * 256 + _bits[3]);
if(_bits[2] == 0x80)
_temperature = t * -0.1;
else
_temperature = t * 0.1;
Problem is related to #52
Solution: Since all negative temperatures of DHT22 are send in two's complement, it is possible to detect sign-magnitude values and to catch if sensor outputs 0x8000 for a temperature lower then 0°C but higher then -0.1°C