forked from adafruit/DHT-sensor-library
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDHT_TempHumidUtils.h
41 lines (27 loc) · 1.21 KB
/
DHT_TempHumidUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef DHT_TEMP_HUMID_UTILS_H
#define DHT_TEMP_HUMID_UTILS_H
/***************************************************************************
* Temperature and humidity utility functions, written as part of:
* https://github.com/zacronos/DHT-sensor-library
* written by Joe Ibershoff
* distributed under MIT license
*
* based in part on the library originally written by Adafruit Industries
* https://github.com/adafruit/DHT-sensor-library
***************************************************************************/
#include "math.h"
class DHT_TempHumidUtils {
public:
static float convertCelsiusToFahrenheit(float tempCelsius);
static float convertFahrenheitToCelsius(float tempFahrenheit);
// Correct to +/- 1.3F when temp >= 80 and humidity >= 40; error is
// possibly larger outside that range
static float computeHeatIndexFahrenheit(float tempFahrenheit, float percentHumidity);
// This has the same error as above, converted to +/- 0.7222C
static float computeHeatIndexCelsius(float tempCelsius, float percentHumidity);
private:
DHT_TempHumidUtils();
// used by the public computeHeadIndex functions
static float computeHeatIndexRothfusz(float tempFahrenheit, float percentHumidity);
};
#endif