winlinvip / SimpleDHT

Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht
MIT License
144 stars 61 forks source link

Incorrect SimpleDHTErr* status returned by read(int pin, ...) and read2(int pin, ...) methods #26

Closed phd closed 5 years ago

phd commented 6 years ago

There is a nasty bug in read()/read2() methods taking the pin argument:

They do not have return statements, so they return random value as temperature reading status.

phd commented 6 years ago

Fix: https://github.com/winlinvip/SimpleDHT/pull/27

tobiasisenberg commented 6 years ago

Noticed the same behavior just now, and indeed your PR fixes the problem. Thanks!