A minimal library for the DHT11.
Fork of DHT11 by
Dht22 Class Reference
Class for the DHT22 sensor. More...
#include <Dht22.h>
Public Member Functions | |
Dht22 (PinName const &p) | |
Construct the sensor object. | |
int | read () |
Update the humidity and temp from the sensor. | |
float | getFahrenheit () |
Get the temp(f) from the saved object. | |
int | getCelsius () |
Get the temp(c) from the saved object. | |
int | getHumidity () |
Get the humidity from the saved object. |
Detailed Description
Class for the DHT22 sensor.
Example:
#include "mbed.h" #include "Dht22.h" Serial pc(USBTX, USBRX); Dht22 sensor(PTD7); int main() { sensor.read() pc.printf("T: %f, H: %d\r\n", sensor.getFahrenheit(), sensor.getHumidity()); }
Definition at line 26 of file Dht22.h.
Constructor & Destructor Documentation
Dht22 | ( | PinName const & | p ) |
Member Function Documentation
int getCelsius | ( | ) |
float getFahrenheit | ( | ) |
int getHumidity | ( | ) |
Generated on Thu Jul 14 2022 03:58:38 by 1.7.2