Patch of original with some casts to get around troubles with log function overrides introduced by recent core updates.

Fork of DHT by Wim De Roeve

Files at this revision

API Documentation at this revision

Comitter:
erigow01
Date:
Wed Nov 26 16:48:17 2014 +0000
Parent:
0:9b5b3200688f
Commit message:
Modified to fix log function calls (was breaking on mapping function due to typing).

Changed in this revision

DHT.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/DHT.cpp	Mon Jul 09 19:47:43 2012 +0000
+++ b/DHT.cpp	Wed Nov 26 16:48:17 2014 +0000
@@ -188,7 +188,7 @@
     SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
     SUM += log10(1013.246);
     float VP = pow(10, SUM-3) * humidity;
-    float T = log(VP/0.61078);   // temp var
+    float T = log((float)(VP/0.61078));   // temp var
     return (241.88 * T) / (17.558-T);
 }
 
@@ -199,7 +199,7 @@
 {
         float a = 17.271;
         float b = 237.7;
-        float temp = (a * celsius) / (b + celsius) + log(humidity/100);
+        float temp = (a * celsius) / (b + celsius) + log((float)(humidity/100));
         float Td = (b * temp) / (a - temp);
         return Td;
 }