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.
Fork of DHT11 by
Diff: Dht11.h
- Revision:
- 0:c1da310d3e8a
- Child:
- 1:5da6f6de3e42
--- /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