DHT_nonblocking
DHT_nonblocking copied to clipboard
Decimal value on DHT11
Hi!
It seems that the DHT11 does actually report 1 decimal for temperature (eg: 19.9 °C) as shown here: https://forum.arduino.cc/index.php?topic=656964.0
Is there any way to obtain the decimal value with this library? (I always get a rounded number, eg: 19.0 or 20.0)
Thank you.
Same issue but I fixed it by looking at the latest Adafruit code. In read_temperature( ) change the relevant case to
case DHT_TYPE_11:
to_return = data[2];
if (data[3] & 0x80) to_return = -1. - to_return;
to_return += (data[3] & 0x0f) * 0.1;
break;
BTW, it works with esp32 and that should be added to library.properties.
Same issue but I fixed it ...
BTW, it works with esp32 and that should be added to library.properties.
Could you please make a pull request so I can update the library?
Thanks!
My git skills are limited, but I think I did it right.
There's another change in the Pull Request - increased COOLDOWN_TIME - that might cause problems elsewhere.
Thanks for maintaining this. Adafruit should adopt it.
A. Peter Allan
On Wed, Jan 6, 2021 at 9:45 AM Ole Wolf [email protected] wrote:
Same issue but I fixed it ...
BTW, it works with esp32 and that should be added to library.properties.
Could you please make a pull request so I can update the library?
Thanks!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/olewolf/DHT_nonblocking/issues/7#issuecomment-755339869, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNKNTHGZLHA5KUMPL437M3SYRZQZANCNFSM4VWZTRNA .