From 16e61f108464a17f5510597acaf4c37cec2f0086 Mon Sep 17 00:00:00 2001 From: Terry J Myers Date: Sun, 9 Apr 2017 19:35:04 -0400 Subject: [PATCH] Modified read speed Reduced delay times from 250ms and 20ms to 1ms. This was done in accordance with the datasheet. E.G. no where does it say you need to wait 250ms or 20ms. It does say to set the line high for a minimum of 1ms (the second delay). This has been tested and is working in my of my projects --- DHT.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DHT.cpp b/DHT.cpp index 86ad91c..1cc1a3e 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -138,12 +138,12 @@ boolean DHT::read(bool force) { // Go into high impedence state to let pull-up raise data line level and // start the reading process. digitalWrite(_pin, HIGH); - delay(250); + delay(1); - // First set data line low for 20 milliseconds. + // First set data line low for 1 millisecond. pinMode(_pin, OUTPUT); digitalWrite(_pin, LOW); - delay(20); + delay(1); uint32_t cycles[80]; {