Class that stores state and functions for DHT.
More...
#include <DHT.h>
Class that stores state and functions for DHT.
◆ DHT()
DHT::DHT |
( |
uint8_t |
pin, |
|
|
uint8_t |
type, |
|
|
uint8_t |
count = 6 |
|
) |
| |
Instantiates a new DHT class.
- Parameters
-
pin | pin number that sensor is connected |
type | type of sensor |
count | number of sensors |
◆ begin()
void DHT::begin |
( |
uint8_t |
usec = 55 | ) |
|
Setup sensor pins and set pull timings.
- Parameters
-
usec | Optionally pass pull-up time (in microseconds) before DHT reading starts. Default is 55 (see function declaration in DHT.h). |
◆ readTemperature()
float DHT::readTemperature |
( |
bool |
S = false , |
|
|
bool |
force = false |
|
) |
| |
Read temperature.
- Parameters
-
S | Scale. Boolean value:
- true = Fahrenheit
- false = Celcius
|
force | true if in force mode |
- Returns
- Temperature value in selected scale
◆ convertCtoF()
float DHT::convertCtoF |
( |
float |
c | ) |
|
Converts Celcius to Fahrenheit.
- Parameters
-
- Returns
- float value in Fahrenheit
◆ convertFtoC()
float DHT::convertFtoC |
( |
float |
f | ) |
|
Converts Fahrenheit to Celcius.
- Parameters
-
- Returns
- float value in Celcius
◆ computeHeatIndex() [1/2]
float DHT::computeHeatIndex |
( |
bool |
isFahrenheit = true | ) |
|
Compute Heat Index Simplified version that reads temp and humidity from sensor.
- Parameters
-
isFahrenheit | true if fahrenheit, false if celcius (default true) |
- Returns
- float heat index
◆ computeHeatIndex() [2/2]
float DHT::computeHeatIndex |
( |
float |
temperature, |
|
|
float |
percentHumidity, |
|
|
bool |
isFahrenheit = true |
|
) |
| |
◆ readHumidity()
float DHT::readHumidity |
( |
bool |
force = false | ) |
|
Read Humidity.
- Parameters
-
- Returns
- float value - humidity in percent
◆ read()
bool DHT::read |
( |
bool |
force = false | ) |
|
Read value from sensor or return last one from less than two seconds.
- Parameters
-
force | true if using force mode |
- Returns
- float value
The documentation for this class was generated from the following files: