PERSONAL USE ONLY

Dependencies:   DHT DHT11 mbed

Files at this revision

API Documentation at this revision

Comitter:
JinxedJinx
Date:
Wed Aug 01 06:28:48 2018 +0000
Commit message:
personal use only;

Changed in this revision

DHT.lib Show annotated file Show diff for this revision Revisions of this file
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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT.lib	Wed Aug 01 06:28:48 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Wimpie/code/DHT/#9b5b3200688f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT11.lib	Wed Aug 01 06:28:48 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/s_inoue_mbed/code/DHT11/#e91c151d1798
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Aug 01 06:28:48 2018 +0000
@@ -0,0 +1,61 @@
+#include "mbed.h"
+
+/*------------------------------------------------------------------------------
+Before to use this example, ensure that you an hyperterminal installed on your
+computer. More info here: https://developer.mbed.org/handbook/Terminals
+
+The default serial comm port uses the SERIAL_TX and SERIAL_RX pins (see their
+definition in the PinNames.h file).
+
+The default serial configuration in this case is 9600 bauds, 8-bit data, no parity
+
+If you want to change the baudrate for example, you have to redeclare the
+serial object in your code:
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+
+Then, you can modify the baudrate and print like this:
+
+pc.baud(115200);
+pc.printf("Hello World !\n");
+------------------------------------------------------------------------------*/
+/*
+DigitalOut led(LED1);
+#include "DHT11.h"
+DHT11 d(D8);
+
+int main()
+{   int s;
+    int hum=0,tem=0;
+
+    printf("Hello World !\n");
+
+    while(1) {
+        wait(1); // 1 second
+        s=d.readData();
+        hum=d.readHumidity();
+        tem=d.readTemperature();
+        printf("Tem = %d Hum = %d\n", tem,hum);
+    }
+}
+*/
+
+
+DigitalOut led(LED1);
+#include "DHT.h"
+DHT d(D8,11);
+
+int main()
+{   int s;
+    float hum=0,tem=0;
+    printf("Hello World !\n");
+
+    while(1) {
+        wait(1); // 1 second
+        s=d.readData();
+        hum=d.ReadHumidity();
+        tem=d.ReadTemperature(KELVIN);
+        tem=tem-273;
+        printf("Tem = %.2f Hum = %.2f\n", tem,hum);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Aug 01 06:28:48 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a7c7b631e539
\ No newline at end of file