Skip to content

Commit

Permalink
Resolve adafruit#24 by adding convert F to C function.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdicola committed Jul 26, 2014
1 parent f2a48d6 commit 7f7425f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DHT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ float DHT::convertCtoF(float c) {
return c * 9 / 5 + 32;
}

float DHT::convertFtoC(float f) {
return (f - 32) * 5 / 9;
}

float DHT::readHumidity(void) {
float f;
if (read()) {
Expand Down
1 change: 1 addition & 0 deletions DHT.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class DHT {
void begin(void);
float readTemperature(bool S=false);
float convertCtoF(float);
float convertFtoC(float);
float computeHeatIndex(float tempFahrenheit, float percentHumidity);
float readHumidity(void);
boolean read(void);
Expand Down

0 comments on commit 7f7425f

Please sign in to comment.