![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
DHT11
Fork of DHT11 by
Diff: Dht11.h
- Revision:
- 0:c1da310d3e8a
- Child:
- 1:5da6f6de3e42
diff -r 000000000000 -r c1da310d3e8a Dht11.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Dht11.h Sun Feb 15 02:09:00 2015 +0000 @@ -0,0 +1,24 @@ +#ifndef DHT11_H +#define DHT11_H + +#include "mbed.h" + +#define DHTLIB_OK 0 +#define DHTLIB_ERROR_CHECKSUM -1 +#define DHTLIB_ERROR_TIMEOUT -2 + +class Dht11 { +public: + Dht11(PinName p); + int read(); + int temperature(); + int humidity(); + +private: + int _humidity; + int _temperature; + DigitalInOut _pin; + Timer _timer; +}; + +#endif