Modified DHT11 Library with floated variable to allow readings in Centigrade

Dependencies:   mbed

Dependents:   mbed_plant_rig

Fork of DHT11 by Eric Fossum

Committer:
fossum_13
Date:
Sun Feb 15 02:09:00 2015 +0000
Revision:
0:c1da310d3e8a
Child:
1:5da6f6de3e42
Initial version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fossum_13 0:c1da310d3e8a 1 #ifndef DHT11_H
fossum_13 0:c1da310d3e8a 2 #define DHT11_H
fossum_13 0:c1da310d3e8a 3
fossum_13 0:c1da310d3e8a 4 #include "mbed.h"
fossum_13 0:c1da310d3e8a 5
fossum_13 0:c1da310d3e8a 6 #define DHTLIB_OK 0
fossum_13 0:c1da310d3e8a 7 #define DHTLIB_ERROR_CHECKSUM -1
fossum_13 0:c1da310d3e8a 8 #define DHTLIB_ERROR_TIMEOUT -2
fossum_13 0:c1da310d3e8a 9
fossum_13 0:c1da310d3e8a 10 class Dht11 {
fossum_13 0:c1da310d3e8a 11 public:
fossum_13 0:c1da310d3e8a 12 Dht11(PinName p);
fossum_13 0:c1da310d3e8a 13 int read();
fossum_13 0:c1da310d3e8a 14 int temperature();
fossum_13 0:c1da310d3e8a 15 int humidity();
fossum_13 0:c1da310d3e8a 16
fossum_13 0:c1da310d3e8a 17 private:
fossum_13 0:c1da310d3e8a 18 int _humidity;
fossum_13 0:c1da310d3e8a 19 int _temperature;
fossum_13 0:c1da310d3e8a 20 DigitalInOut _pin;
fossum_13 0:c1da310d3e8a 21 Timer _timer;
fossum_13 0:c1da310d3e8a 22 };
fossum_13 0:c1da310d3e8a 23
fossum_13 0:c1da310d3e8a 24 #endif