|
|
@@ -3,14 +3,14 @@
|
|
|
|
|
|
#include "DHT.h"
|
|
|
|
|
|
-#define DHTPIN 2 // what pin we're connected to
|
|
|
+#define DHTPIN 2 // what pin we're connected to(DHT10 and DHT20 don't need define it)
|
|
|
|
|
|
// Uncomment whatever type you're using!
|
|
|
//#define DHTTYPE DHT11 // DHT 11
|
|
|
#define DHTTYPE DHT22 // DHT 22 (AM2302)
|
|
|
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
|
|
|
|
|
|
-/*Notice: The DHT10 is different from other DHT* sensor ,it uses i2c interface rather than one wire*/
|
|
|
+/*Notice: The DHT10 and DHT20 is different from other DHT* sensor ,it uses i2c interface rather than one wire*/
|
|
|
/*So it doesn't require a pin.*/
|
|
|
|
|
|
//#define DHTTYPE DHT10
|
|
|
@@ -21,8 +21,8 @@
|
|
|
// Connect pin 4 (on the right) of the sensor to GROUND
|
|
|
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
|
|
|
|
|
|
-DHT dht(DHTPIN, DHTTYPE);
|
|
|
-//DHT dht(DHTTYPE); //DHT11 DHT20 don't need to define Pin
|
|
|
+DHT dht(DHTPIN, DHTTYPE); //DHT11 DHT21 DHT22
|
|
|
+//DHT dht(DHTTYPE); //DHT10 DHT20 don't need to define Pin
|
|
|
#if defined(ARDUINO_ARCH_AVR)
|
|
|
#define debug Serial
|
|
|
|