Closed danielfaust closed 6 years ago
👍
Release 1.0.8.
It seems that you only fixed for DHT22, not for DHT11? Could you please fix it for DHT11 at https://github.com/winlinvip/SimpleDHT/blob/master/SimpleDHT.cpp#L112 ?
I don't have a DHT11 to test with. But since the DHT11 only works with temperatures equal to or above 0 °C, I think that sign flag never gets set. I preferred not to touch that code.
👌 Agreed, I will release a new version.
This commit fixes issue https://github.com/winlinvip/SimpleDHT/issues/14 The MSB carries the sign information, which is filtered with
& 0x8000
. If the flag is present, the remainder will get multiplied by-1
. All the remaining bits contain the value and are filtered with& 0x7FFF
.