diff --git a/DHT.cpp b/DHT.cpp index fe55016..2ef244c 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -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()) { diff --git a/DHT.h b/DHT.h index 8f40a02..5280f9c 100644 --- a/DHT.h +++ b/DHT.h @@ -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);