A minimal library for the DHT11.

Dependencies:   mbed

Dependents:   EXP10_DHT11_LCD Sushil_MODSERIAL Core1000_SmartFarm idd_summer17_hw3_evey_jenny_seiyoung ... more

Dht11.h

Committer:
fossum_13
Date:
2015-02-15
Revision:
0:c1da310d3e8a
Child:
1:5da6f6de3e42

File content as of revision 0:c1da310d3e8a:

#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