Simple library for the DHT11 temperature and humidity sensor. Forked from an existing Mbed DHT11 project.
Simple DHT11 temperature and humidity library.
Example usage
#include "mbed.h" #include "DHT11.h" DHT11 dht(D8); // Change pin name here if required main() { printf("T:%d, H:%d\r\n", dht.readTemperature(), dht.readHumidity()); }
The sensor may be read as often as desired, but temperature and humidity values are cached and will only be updated if they are more than 2 seconds old. This is the underlying sensor update rate.
Please note that this project has been modified only enough to make it work for its intended purpose. Various parts of this project still need work, and the source code should not be seen as an example of best practice.
Diff: DHT11.h
- Revision:
- 1:95b80cc3f676
- Parent:
- 0:4d4c5ea17d86
- Child:
- 2:1e997b7a1f9a
--- a/DHT11.h Wed Sep 10 15:14:31 2014 +0000 +++ b/DHT11.h Wed Sep 10 15:58:15 2014 +0000 @@ -1,4 +1,4 @@ -/** @file +/** Library for the use of the DHT11, a temperature and humidity sensor Shigenori Inoue, September 10, 2014 */