DHT22_Fail

Dependencies:   mbed

Revision:
0:b8130f9ba1c3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 18 09:16:00 2018 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "DHT.h"
+
+#define DHTPIN 2     // what pin we're connected to
+//Serial 
+DigitalOut myled(LED1);
+
+
+int main() {
+    
+    DHT.begin();
+    float t;
+    float h;
+    
+    while(1) {
+        
+        t = dht.readTemperature();
+        h = dht.readHumidity();
+        //led = 1; // LED is ON
+        //wait(1.0); // 200 ms
+        myled = 0; // LED is OFF
+        //wait(1.0); // 1 sec
+    }
+}