Modified DHT11 Library with floated variable to allow readings in Centigrade

Dependencies:   mbed

Dependents:   mbed_plant_rig

Fork of DHT11 by Eric Fossum

Files at this revision

API Documentation at this revision

Comitter:
Demonthorn
Date:
Mon Jul 10 15:20:33 2017 +0000
Parent:
1:5da6f6de3e42
Commit message:
Floated Variables to correct improper Centigrade readings

Changed in this revision

Dht11.cpp Show annotated file Show diff for this revision Revisions of this file
Dht11.h Show annotated file Show diff for this revision Revisions of this file
--- a/Dht11.cpp	Mon Feb 16 01:43:08 2015 +0000
+++ b/Dht11.cpp	Mon Jul 10 15:20:33 2017 +0000
@@ -80,10 +80,10 @@
     return((_temperature * 1.8) + 32);
 }
 
-int Dht11::getCelsius() {
+float Dht11::getCelsius() {
     return(_temperature);
 }
 
-int Dht11::getHumidity() {
+float Dht11::getHumidity() {
     return(_humidity);
 }
--- a/Dht11.h	Mon Feb 16 01:43:08 2015 +0000
+++ b/Dht11.h	Mon Jul 10 15:20:33 2017 +0000
@@ -51,14 +51,14 @@
      * @returns
      *   Celsius int
      */
-    int getCelsius();
+    float getCelsius();
     
     /** Get the humidity from the saved object.
      *
      * @returns
      *   Humidity percent int
      */
-    int getHumidity();
+    float getHumidity();
 
 private:
     /// percentage of humidity