Pablo Lopez / Mbed 2 deprecated Nucleo_sHT-HumedadyTemperatura

Dependencies:   mbed DHT

Files at this revision

API Documentation at this revision

Comitter:
pablolopez89
Date:
Sun May 12 01:50:01 2019 +0000
Commit message:
Sensor de Humedad y Temperatura dht22

Changed in this revision

DHT.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 f2be568faec6 DHT.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT.lib	Sun May 12 01:50:01 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Wimpie/code/DHT/#9b5b3200688f
diff -r 000000000000 -r f2be568faec6 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun May 12 01:50:01 2019 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "DHT.h"
+ 
+DigitalOut myled(LED1);
+ 
+DHT sensor(PA_0,DHT22); // Use the SENdht22 sensor
+
+Serial PC(USBTX, USBRX);//Serial LOG
+ 
+int main() {
+    int err;
+    PC.printf("\r\nDHT Test program");
+    PC.printf("\r\n******************\r\n");
+    wait(1); // wait 1 second for device stable status
+    while (1) {
+        myled = 1;
+        err = sensor.readData();
+        if (err == 0) {
+            PC.printf("Temperature is %4.2f C \r\n",sensor.ReadTemperature(CELCIUS));
+            //PC.printf("Temperature is %4.2f F \r\n",sensor.ReadTemperature(FARENHEIT));
+            //PC.printf("Temperature is %4.2f K \r\n",sensor.ReadTemperature(KELVIN));
+            PC.printf("Humidity is %4.2f \r\n",sensor.ReadHumidity());
+            //PC.printf("Dew point is %4.2f  \r\n",sensor.CalcdewPoint(sensor.ReadTemperature(CELCIUS), sensor.ReadHumidity()));
+            //PC.printf("Dew point (fast) is %4.2f  \r\n",sensor.CalcdewPointFast(sensor.ReadTemperature(CELCIUS), sensor.ReadHumidity()));
+        } 
+       // else
+        //    PC.printf("\r\nErr %i \n",err);
+        myled = 0;
+        wait(1);
+    }
+
+}
\ No newline at end of file
diff -r 000000000000 -r f2be568faec6 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun May 12 01:50:01 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file