Adding .ino files for IoTCloud library tests (periodic write and sleep); adding DHT...
[iotcloud.git] / version2 / src / others / DHT / DHT.h
1 #ifndef DHT_H\r
2 #define DHT_H\r
3 #if ARDUINO >= 100\r
4  #include "Arduino.h"\r
5 #else\r
6  #include "WProgram.h"\r
7 #endif\r
8 \r
9 /* DHT library \r
10 \r
11 MIT license\r
12 written by Adafruit Industries\r
13 */\r
14 \r
15 // how many timing transitions we need to keep track of. 2 * number bits + extra\r
16 #define MAXTIMINGS 85\r
17 \r
18 #define DHT11 11\r
19 #define DHT22 22\r
20 #define DHT21 21\r
21 #define AM2301 21\r
22 \r
23 class DHT {\r
24  private:\r
25   uint8_t data[6];\r
26   uint8_t _pin, _type, _count;\r
27   unsigned long _lastreadtime;\r
28   boolean firstreading;\r
29 \r
30  public:\r
31   DHT(uint8_t pin, uint8_t type, uint8_t count=6);\r
32   void begin(void);\r
33   float readTemperature(bool S=false);\r
34   float convertCtoF(float);\r
35   float convertFtoC(float);\r
36   float computeHeatIndex(float tempFahrenheit, float percentHumidity);\r
37   float readHumidity(void);\r
38   boolean read(void);\r
39 \r
40 };\r
41 #endif\r