Dante Carrillo / Mbed 2 deprecated DDDH11

Dependencies:   mbed DHT

Files at this revision

API Documentation at this revision

Comitter:
dantecarrillo
Date:
Thu Jun 16 04:35:12 2022 +0000
Parent:
1:6bcb143683f3
Commit message:
DDDH11

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Mar 10 21:33:31 2015 +0000
+++ b/main.cpp	Thu Jun 16 04:35:12 2022 +0000
@@ -2,12 +2,12 @@
 #include "mbed.h"
 #include "DHT.h"
 
-DHT sensor(D4, DHT11);
+DHT sensor(PA_0, DHT11);
 
 int main()
 {
     int error = 0;
-    float h = 0.0f, c = 0.0f, f = 0.0f, k = 0.0f, dp = 0.0f, dpf = 0.0f;
+    float h = 0.0f, c = 0.0f, f = 0.0f, k = 0.0f;
 
     while(1) {
         wait(2.0f);
@@ -17,10 +17,8 @@
             f   = sensor.ReadTemperature(FARENHEIT);
             k   = sensor.ReadTemperature(KELVIN);
             h   = sensor.ReadHumidity();
-            dp  = sensor.CalcdewPoint(c, h);
-            dpf = sensor.CalcdewPointFast(c, h);
-            printf("Temperature in Kelvin: %4.2f, Celcius: %4.2f, Farenheit %4.2f\n", k, c, f);
-            printf("Humidity is %4.2f, Dewpoint: %4.2f, Dewpoint fast: %4.2f\n", h, dp, dpf);
+            printf("Kelvin: %4.2f, Celcius: %4.2f, Farenheit %4.2f\n", k, c, f);
+            printf("Humedad %4.2f", h);
         } else {
             printf("Error: %d\n", error);
         }