bertmelis / DHT

DHT library (non blocking, interrupt driven with a callback)
MIT License
12 stars 3 forks source link

Only integer values read? #7

Closed dmelgar closed 5 years ago

dmelgar commented 5 years ago

The spec state 8 bit integer value and 8 bit decimal value, yet the only values returned from the examples return integer values as floats with no fractional component.

Is this a configuration option or is this library not parsing the full 40 bit data response?

bertmelis commented 5 years ago

It depends if you define your sensor as DHT11, then no decimals will be returned, as the sensor's accuracy is not up to decimal level.

Change your sensor to type DHT22 and it'll work. (or there's a bug somewhere)

For example: comment out https://github.com/bertmelis/DHT/blob/master/examples/Callback/Callback.ino#L34 and enable https://github.com/bertmelis/DHT/blob/master/examples/Callback/Callback.ino#L35

bertmelis commented 5 years ago

Did it work?