adafruit / Adafruit_CircuitPython_DHT

CircuitPython support for DHT11 and DHT22 type temperature/humidity devices
MIT License
179 stars 62 forks source link

modified get_pulses to reduce errors #8

Closed jerryneedell closed 6 years ago

jerryneedell commented 6 years ago

There were often errors associated with prematurely cutting off the pulse train. Rather than depend on the exact number of incoming pulses, which varies depending on the timing of the start up, what for a timeout interval than always use the last 81 pulses received. This reduces the number of errors , especially on the faster M4 boards.

Also added a test to see if this was a dht11 and increased the delay between reads to 1 second as in the data sheet. dht22 uses .5 seconds

jerryneedell commented 6 years ago

@mrmcwethy @tannewt Any concerns with this?

mrmcwethy commented 6 years ago

@jerryneedell I looked at what you did and I agree with it. Nice job.