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.
Revisions of DHT11.h
Revision | Date | Message | Actions |
---|---|---|---|
13:11d0770eb603 | 2021-09-15 | Interface changes to remove the need for separate readData() calls | File Diff Annotate |
12:af1eadec17e5 | 2021-05-31 | Update to MbedOS6+ | File Diff Annotate |
10:f0d789f49df7 | 2014-09-16 | License has been changed from Apache2 to MIT lisence. | File Diff Annotate |
9:056d1e9b428c | 2014-09-11 | Bug fix | File Diff Annotate |
5:da586c935e88 | 2014-09-10 | Doxygen documentation has been corrected. | File Diff Annotate |
4:48798b126d93 | 2014-09-10 | Doxygen documentation has been corrected. | File Diff Annotate |
3:8cd064147bde | 2014-09-10 | Doxygen description has been corrected. | File Diff Annotate |
2:1e997b7a1f9a | 2014-09-10 | Error code description was changed from integers to enums. | File Diff Annotate |
1:95b80cc3f676 | 2014-09-10 | @file was removed. | File Diff Annotate |
0:4d4c5ea17d86 | 2014-09-10 | First version of the library for the use of DHT11, temperature and humidity sensor | File Diff Annotate |