EXP11

Dependencies:   DHT11 TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
rx5
Date:
Wed Apr 13 06:28:20 2016 +0000
Commit message:
EXP10

Changed in this revision

DHT11.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 000000000000 -r 78a7d5cdbf61 DHT11.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT11.lib	Wed Apr 13 06:28:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/fossum_13/code/DHT11/#5da6f6de3e42
diff -r 000000000000 -r 78a7d5cdbf61 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Wed Apr 13 06:28:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 78a7d5cdbf61 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 13 06:28:20 2016 +0000
@@ -0,0 +1,28 @@
+
+#include "mbed.h"
+#include "Dht11.h"
+#include "TextLCD.h"
+
+TextLCD lcd(D2, D3, D4, D5, D6, D7); // Initlize LCD PIN => RS, EN, Data4, Data5, Data6, Data7
+Dht11 mydht11(D9);
+int main(void) {
+    
+    lcd.cls(); // Clear LCD
+    lcd.locate(0,0); // cursor on Col=0, Raw=0
+    lcd.printf("Experiment - 10"); // print startup message on LCD first Raw
+    lcd.locate(0,1); // cursor on Col=0, Raw=1
+    lcd.printf("DHT11 with LCD"); // print startup message on LCD second Raw
+    wait(3.0); // wait 3 second to show startup message
+    while (true) {
+        float t,h;
+        mydht11.read(); // Read DHT11 sensor
+        t = mydht11.getCelsius(); // get Temperature in C
+        h = mydht11.getHumidity(); // get Humidity in %
+        lcd.cls(); // Clear LCD
+        lcd.locate(0,0); // cursor on Col=0, Raw=0
+        lcd.printf("Temp = %0.2f C",t); //Print Temperature Value on LCD first line
+        lcd.locate(0,1); // cursor on Col=0, Raw=1
+        lcd.printf("Humd = %0.2f %%",h); //Print Humidity Value on LCD Second line
+        wait(1.0);
+    }
+}
diff -r 000000000000 -r 78a7d5cdbf61 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 13 06:28:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/99a22ba036c9
\ No newline at end of file