Browse Source

Update DHT.cpp

Steven Conaway 7 years ago
parent
commit
2dfa77993d
1 changed files with 7 additions and 1 deletions
  1. 7 1
      DHT.cpp

+ 7 - 1
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;