Embedded for 11U68 DHT LCD Sensor Demo

Dependencies:   DHT TextLCD mbed

Fork of TextLCD_HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
Hapi_Tech
Date:
Tue Jul 21 08:02:46 2015 +0000
Parent:
2:ad0b044d0a10
Commit message:
DHT sensor DEMO

Changed in this revision

DHT.lib Show annotated file Show diff for this revision Revisions of this file
TextLCD.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 ad0b044d0a10 -r ad558d3aaa98 DHT.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT.lib	Tue Jul 21 08:02:46 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/components/code/DHT/#df22ddf10d75
diff -r ad0b044d0a10 -r ad558d3aaa98 TextLCD.lib
--- a/TextLCD.lib	Sat Dec 04 11:31:07 2010 +0000
+++ b/TextLCD.lib	Tue Jul 21 08:02:46 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/simon/code/TextLCD/#e4cb7ddee0d3
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r ad0b044d0a10 -r ad558d3aaa98 main.cpp
--- a/main.cpp	Sat Dec 04 11:31:07 2010 +0000
+++ b/main.cpp	Tue Jul 21 08:02:46 2015 +0000
@@ -1,10 +1,36 @@
-// Hello World! for the TextLCD
-
+/*TextLCD indicate RHT sensor
+LCD::LinkMan TC1602E-25A 
+RHT sensor::DHT11
+Main board::Embedded for 11U68 HAPI-Tech-Solution,Inc
+Shiled::Arduino Universal shiled P-06877
+*/
 #include "mbed.h"
 #include "TextLCD.h"
-
-TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
+#include "DHT.h"
+DHT sensor(P1_25,SEN11301P); // Use the SEN11301P sensor
+TextLCD lcd(P1_28, P2_3, P0_2, P0_9, P0_8, P1_29,TextLCD::LCD16x2); // rs, e, d4-d7
 
 int main() {
-    lcd.printf("Hello World!\n");
+    int err;
+    lcd.locate(0,0);
+    lcd.printf("DHT Test program\n");
+    wait(1); // wait 1 second for device stable status
+    while (1) {
+        err = sensor.readData();
+        if (err == 0) {
+            lcd.locate(0,0);
+            lcd.printf("Room Temp:%4.2f C\n",sensor.ReadTemperature(CELCIUS));
+            lcd.locate(0,1);
+            lcd.printf("Room RH%:%4.2f %\n",sensor.ReadHumidity());
+            wait_ms(1500);
+            lcd.cls();
+            lcd.locate(0,0);
+            lcd.printf("Dew point is %4.2f \n",sensor.CalcdewPoint(sensor.ReadTemperature(CELCIUS), sensor.ReadHumidity()));
+            wait_ms(1500);
+            lcd.cls();
+        }else if (err != 0); 
+            lcd.locate(0,0);
+            lcd.printf("Err %i \n",err);
+        wait(1);
+    }
 }
diff -r ad0b044d0a10 -r ad558d3aaa98 mbed.bld
--- a/mbed.bld	Sat Dec 04 11:31:07 2010 +0000
+++ b/mbed.bld	Tue Jul 21 08:02:46 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e
+http://mbed.org/users/mbed_official/code/mbed/builds/da0ca467f8b5
\ No newline at end of file