RobTillaart / DHTNew

Arduino library for DHT11 and DHT22 with automatic sensor recognition
MIT License
98 stars 15 forks source link

Update dhtnew.cpp #41

Closed PascalCorpsman closed 3 years ago

PascalCorpsman commented 3 years ago

Fixed reading error for negative numbers on DHT22 module

=> i originally fixed this in dhtstable, and it works great on my arduino nano, while the original code always gives mit -32*. values

With this the "hack" of negating the result is not needed

RobTillaart commented 3 years ago

Thanks for this fix, it looks good. I'll need to check DHTstable :)

The #include <stdint.h> is not needed. The code already uses uint8_t quite a lot so int16_t is available. Can you verify that?

PascalCorpsman commented 3 years ago

i overlooked your code (now in more detail) in the header file you include which itself includes stdint.h so technically my include of stdint.h is not needed and it is working without the include.

Do i have to create a nother pull request for that ?

PascalCorpsman commented 3 years ago

By the way, as stdint.h is using inclusion guards it does not harm the code as the preprocessor skippes it ..