Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DHT11_Hello_World IBMIoTClientEthernetExample_W5200 AutoPlants PB_Emma_Ethernet ... more
DHT11 Class Reference
Example: More...
#include <DHT11.h>
Public Member Functions | |
| DHT11 (PinName pin) | |
| Create a DHT11 interface. | |
| int | readData (void) |
| Reading the data from the DHT11. | |
| int | readHumidity (void) |
| Reading the humidity from the data. | |
| int | readTemperature (void) |
| Reading the temperature from the data. | |
Detailed Description
Example:
#include "mbed.h" #include "DHT11.h" DHT11 d; main() { int s; s = d.readData(); if (s != DHT11::OK) { printf("Error!\r\n"); } else { printf("T:%d, H:%d\r\n", d.readTemperature(), d.readHumidity()); } }
Definition at line 44 of file DHT11.h.
Constructor & Destructor Documentation
| DHT11 | ( | PinName | pin ) |
Member Function Documentation
| int readData | ( | void | ) |
| int readHumidity | ( | void | ) |
Reading the humidity from the data.
- Returns:
- Humidity in %, regardless of the error from readData()
| int readTemperature | ( | void | ) |
Reading the temperature from the data.
- Returns:
- Temperature in Celcius, regardless of the error from readData()
Generated on Wed Jul 13 2022 02:12:33 by
1.7.2