DHT11 readout library
|
A library to access the DHT11 temperature and humidity sensor. This device uses its own one wire protocol and the library allows to
Copyright U. Raich Oct. 2017
This program is part of a course on embedded systems held at the University of Cape Coast, Ghana in 2017
It is released under the GNU Public License.
For details please see https://www.gnu.org/licenses/gpl.html
More...
Functions | |
void | dht11SetDebug (bool onOff) |
switches debug mode on or off More... | |
void | dht11PrintError (int err) |
prints an error message in human understandable form More... | |
void | dht11Init () |
connects to the wiringPi library | |
int | dht11Measurement () |
make a measurement and saves the data in an internal array returns DHT11_SUCCESS if successful DHT11_MISSING_INIT if dht11Init has not been called before | |
int | dht11GetTemperature () |
returns the measured temperature value in degrees C More... | |
int | dht11GetValidTemperature () |
returns the measured temperature value in degrees C More... | |
int | dht11GetHumidity () |
returns the measured humidity value in % More... | |
int | dht11GetValidHumidity () |
returns the measured humidity value in % More... | |
time_t | dht11GetMeasTimeStamp () |
returns the time stamp of the last measurement More... | |
time_t | dht11GetValidMeasTimeStamp () |
returns the time stamp of the last valid measurement More... | |
int | dht11GetRawData (int *rawData) |
returns the measured data independent of the checksum test More... | |
int | dht11GetValidRawData (int *rawData) |
returns the measured data which were checked by the checksum test More... | |
int | dht11GetChecksum () |
returns the checksum as calculated from the data | |
int | dht11GetDeviceChecksum () |
returns the checksum as read from the dht11 | |
A library to access the DHT11 temperature and humidity sensor. This device uses its own one wire protocol and the library allows to
Copyright U. Raich Oct. 2017
This program is part of a course on embedded systems held at the University of Cape Coast, Ghana in 2017
It is released under the GNU Public License.
For details please see https://www.gnu.org/licenses/gpl.html
:
int dht11GetHumidity | ( | void | ) |
returns the measured humidity value in %
time_t dht11GetMeasTimeStamp | ( | void | ) |
returns the time stamp of the last measurement
int dht11GetRawData | ( | int * | rawData | ) |
returns the measured data independent of the checksum test
int | *rawData is a pointer to an integer array of a size of at least DHT11_PROTOCOL_SIZE integer values. If a NULL pointer is passed to the routine, it will allocate memory space big enough to hold the data. In this case the caller must free the allocated memory after use |
int dht11GetTemperature | ( | void | ) |
returns the measured temperature value in degrees C
int dht11GetValidHumidity | ( | void | ) |
returns the measured humidity value in %
time_t dht11GetValidMeasTimeStamp | ( | void | ) |
returns the time stamp of the last valid measurement
int dht11GetValidRawData | ( | int * | rawData | ) |
returns the measured data which were checked by the checksum test
int | *rawData is a pointer to an integer array of a size of at least DHT11_PROTOCOL_SIZE integer values. If a NULL pointer is passed to the routine, it will allocate memory space bit enough to hold the data. In this case the caller must free the allocated memory after use |
int dht11GetValidTemperature | ( | void | ) |
returns the measured temperature value in degrees C
void dht11PrintError | ( | int | err | ) |
prints an error message in human understandable form
an | error code returned by the library |
void dht11SetDebug | ( | bool | onOff | ) |
switches debug mode on or off
onOff | true: switches debug mode on false: switches debug mode off |