capt

Dependencies:   DHT11 mbed

Files at this revision

API Documentation at this revision

Comitter:
wallsow
Date:
Thu Jan 26 01:17:07 2017 +0000
Commit message:
capt;

Changed in this revision

DHT11.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r db7c4dcecc70 DHT11.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT11.lib	Thu Jan 26 01:17:07 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/s_inoue_mbed/code/DHT11/#e91c151d1798
diff -r 000000000000 -r db7c4dcecc70 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jan 26 01:17:07 2017 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "DHT11.h"
+
+DHT11 sensor(D4);
+
+
+
+//---------------
+int main()
+{
+    //serial config
+    Serial serial(PA_0,PA_1);  /*PA_0=A0=TX PA_1=A0=RX*/
+    serial.baud(9600);
+    serial.format(8,SerialBase::None,1);
+    serial.printf("\r\nDHT Test program");
+    serial.printf("\r\n****************\r\n");
+    //char tmp[30];//="AT$SS=00 12 FF 42 \r\n";//$SS
+    
+    
+    while(1){
+
+    int s,T,H;
+    s = sensor.readData();
+    T=sensor.readTemperature();
+    H=sensor.readHumidity();
+    if (s != DHT11::OK) {
+        serial.printf("Error!\r\n");
+    }
+    else {
+        serial.printf("AT$SS=%x%x\r\n", T,H);
+    }
+    
+    wait(60);
+}
+}
diff -r 000000000000 -r db7c4dcecc70 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jan 26 01:17:07 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab
\ No newline at end of file