DHT
Class to read data from DHT11 humidity and temperature sensor.
Public Types
Type
Name
enum
eError { DHT11 = 11, SEN11301P = 11, RHT01 = 11, DHT22 = 22, AM2302 = 22, SEN51035P = 22, RHT02 = 22, RHT03 = 22, ERROR_NONE = 0, BUS_BUSY =1, ERROR_NOT_PRESENT =2, ERROR_ACK_TOO_LONG =3, ERROR_SYNC_TIMEOUT = 4, ERROR_DATA_TIMEOUT =5, ERROR_CHECKSUM = 6, ERROR_NO_PATIENCE =7 }
enum
eError { DHT11 = 11, SEN11301P = 11, RHT01 = 11, DHT22 = 22, AM2302 = 22, SEN51035P = 22, RHT02 = 22, RHT03 = 22, ERROR_NONE = 0, BUS_BUSY =1, ERROR_NOT_PRESENT =2, ERROR_ACK_TOO_LONG =3, ERROR_SYNC_TIMEOUT = 4, ERROR_DATA_TIMEOUT =5, ERROR_CHECKSUM = 6, ERROR_NO_PATIENCE =7 }
enum
eScale { CELCIUS =0, FARENHEIT =1, KELVIN =2 }
Public Functions
Type
Name
DHT (PinName pin, int DHTtype)
~DHT ()
int
readData (void)
float
ReadHumidity (void)
float
ReadTemperature (eScale Scale)
float
CalcdewPoint (float celsius, float humidity)
float
CalcdewPointFast (float celsius, float humidity)
Public Types Documentation
enum eError
enum eError
enum eScale
Public Functions Documentation
function DHT
DHT constructor
Parameters:
pin data pin of sensor
DHTtype type of sensor
function ~DHT
function readData
read the data from sensor
Returns:
eError or 0 in case of no error
function ReadHumidity
read last humidity, readData has to be called to update the value
Returns:
humidity in %
function ReadTemperature
read last temperature, readData has to be called to update the value
Parameters:
Scale select the scale (CELCIUS, FARENHEIT or KELVIN)
Returns:
temperature in selected scale
function CalcdewPoint
function CalcdewPointFast
The documentation for this class was generated from the following file: D:/w/hw-libs/\_libs\_/libraries/DHT.h
Last updated