DHT22 Temp & Humidity Sensor Library
v0.6
Library for the DHT22/CM3202/AM3202 Temperature and Humidity Module
|
This Propeller C library was created for the DHT22 temperature and humidity sensor module. More...
Go to the source code of this file.
Macros | |
#define | __DHT22_SENSOR_H__ |
#define | CELSIUS 0 |
#define | FAHRENHEIT 1 |
#define | KELVIN 2 |
Functions | |
char | dht22_read (int dht_pin) |
Triggers a reading from the temperature and humidity from the sensor module. More... | |
void | dht22_set_timeout_ignore (int dht_pin, char ignore_timeout) |
The function is used to set or clear an ignore timeout instruction for modules connected to the specified pin. More... | |
int | dht22_getTemp (char temp_units) |
Retrieves the last temperature reading made by the read_dht22() function. More... | |
int | dht22_getHumidity () |
Retrieves the last humidity reading made by the read_dht22() function. More... | |
This Propeller C library was created for the DHT22 temperature and humidity sensor module.
This Propeller C library was created for the DHT22/CM2302 temperature and humidity sensor module.
int dht22_getHumidity | ( | ) |
Retrieves the last humidity reading made by the read_dht22() function.
int dht22_getTemp | ( | char | temp_units | ) |
Retrieves the last temperature reading made by the read_dht22() function.
temp_units | allows the temperature unit to be specified in (0) Celsius, (1) Fahrenheit, or (2) Kelvin. |
char dht22_read | ( | int | dht_pin | ) |
Triggers a reading from the temperature and humidity from the sensor module.
This function instructs the temperature and humidity sensor module to take a reading.
dht_pin | defines which pin the sensor is attached to. Requires a 10 kOhm pullup resistor to 3.3V when connecting to the Propeller MCU. |
void dht22_set_timeout_ignore | ( | int | dht_pin, |
char | ignore_timeout | ||
) |
The function is used to set or clear an ignore timeout instruction for modules connected to the specified pin.
dht_pin | defines which pin the sensor is attached to. |
ignore_timeout | when true (1), the function instructs the Propeller MCU to ignore the protective timeout that prevents the sensor from being read before it is ready. This parameter is set to false (0) by default. |