Modified DHT11 Library with floated variable to allow readings in Centigrade
Fork of DHT11 by
Revision 2:65c4ca53154d, committed 2017-07-10
- 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 |
diff -r 5da6f6de3e42 -r 65c4ca53154d Dht11.cpp --- 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); }
diff -r 5da6f6de3e42 -r 65c4ca53154d Dht11.h --- 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