Closed RobTillaart closed 3 years ago
As the DHT has an operational range from -40°C (-40°F) it fails for the lowest temperatures.
Bug is in line 202
if(_bits[2] == 0x80) { _temperature = -_temperature; }
works well down to -25.5 C but not below that, as the _bits[2] will be 0x81 for such low temperatures. For most applications this is not an issue, but it is still a bug.
Code proposal
if(_bits[2] & 0x80 != 0) { _temperature = -_temperature; }
Unfortunately I cannot test down to -40°C (my fridge goes to -20 or so)
if( (_bits[2] & 0x80) == 0x80 ) is more explicit.
As the DHT has an operational range from -40°C (-40°F) it fails for the lowest temperatures.
Bug is in line 202
works well down to -25.5 C but not below that, as the _bits[2] will be 0x81 for such low temperatures. For most applications this is not an issue, but it is still a bug.
Code proposal
Unfortunately I cannot test down to -40°C (my fridge goes to -20 or so)