From 6b8b1ccdb998abf526f1fd2cd24c7360ddacc5f5 Mon Sep 17 00:00:00 2001 From: Steven Conaway Date: Mon, 30 Jul 2018 11:23:35 -0700 Subject: [PATCH 1/3] Update DHT.cpp --- DHT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DHT.cpp b/DHT.cpp index 86ad91c..fb9e9df 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -18,7 +18,7 @@ DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) { _maxcycles = microsecondsToClockCycles(1000); // 1 millisecond timeout for // reading pulses from DHT sensor. // Note that count is now ignored as the DHT reading algorithm adjusts itself - // basd on the speed of the processor. + // based on the speed of the processor. } void DHT::begin(void) { From f771939337ab989755e21999a1ba152e9bc9d82e Mon Sep 17 00:00:00 2001 From: Steven Conaway Date: Mon, 30 Jul 2018 11:27:30 -0700 Subject: [PATCH 2/3] Update DHT.h --- DHT.h | 1 + 1 file changed, 1 insertion(+) diff --git a/DHT.h b/DHT.h index d81f6db..4f35160 100644 --- a/DHT.h +++ b/DHT.h @@ -42,6 +42,7 @@ class DHT { float readTemperature(bool S=false, bool force=false); float convertCtoF(float); float convertFtoC(float); + float computeHeatIndex(bool isFahrenheit=true); float computeHeatIndex(float temperature, float percentHumidity, bool isFahrenheit=true); float readHumidity(bool force=false); boolean read(bool force=false); From 2dfa77993d7a17a130b793a41ea0ffe4fa2aeca9 Mon Sep 17 00:00:00 2001 From: Steven Conaway Date: Mon, 30 Jul 2018 11:31:34 -0700 Subject: [PATCH 3/3] Update DHT.cpp --- DHT.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DHT.cpp b/DHT.cpp index fb9e9df..9f154d5 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -89,7 +89,13 @@ float DHT::readHumidity(bool force) { } //boolean isFahrenheit: True == Fahrenheit; False == Celcius -float DHT::computeHeatIndex(float temperature, float percentHumidity, bool isFahrenheit) { +float DHT::computeHeatIndex(isFahrenheit) { + float hi = self.computeHeatIndex(self.readTemperature(isFahrenheit), self.readHumidity(), isFahrenheit); + return isFahrenheit ? hi : convertFtoC(hi); +} + +//boolean isFahrenheit: True == Fahrenheit; False == Celcius +float DHT::computeHeatIndex(float temperature, floast percentHumidity, bool isFahrenheit) { // Using both Rothfusz and Steadman's equations // http://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml float hi;