Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 10 months ago.
The DHT is giving a round value
Hello,
why the DHT lib is given me a round value? can it be more precise? like 25.5 for example? or it is a hardware limitation: the sensor cannot give more accurate values.
Thanks and best regards.
Question relating to:
1 Answer
8 years, 10 months ago.
I don't know the sensors but the code in the library implies that the DHT11 is only accurate to the nearest whole number while the DHT22 should output to the nearest 1/10th. However for some reason despite trying to calculate the value to the nearest 1/10th the library uses an integer to store the result.
Edit DHT.cpp and change lines 139 and 211 from int v; to float v; and it should work correctly.