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
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.13
installed DHT-sensor-library version: 1.4.1 / installed by Arduino IDE Lib manager
I use the DHT22 in combination with an ESP8266 and this lib.
When having negative temperatures, the resulting value of readTemperature() is -3278.6 at -0.1°C
To fix negatives values a recalculation is nessecary:
#include <stdint.h>
float temperature = dht.readTemperature();
if(temperature < 0)
{
temperature = (temperature = (INT16_MAX - temperature*-10)*-0.1; - temperature*-10)*-0.1;
}
after some research, i figure out, that the values in data-array repressents an intager in ones complement, while the rest of data handling seems to be in BCD.
I will provide an PR to fix this issue.