Drivers and example program

Dependencies:   DHT mbed

Fork of Seeed_Grove_Temp_Humidity_Example by Seeed

Revision:
2:5f336f6ec4d5
Parent:
0:c12c28a0f9e7
--- a/main.cpp	Tue Mar 10 21:33:31 2015 +0000
+++ b/main.cpp	Fri Nov 06 16:38:49 2015 +0000
@@ -3,6 +3,8 @@
 #include "DHT.h"
 
 DHT sensor(D4, DHT11);
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX); // tx, rx
 
 int main()
 {
@@ -19,10 +21,10 @@
             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);
+            pc.printf("Temperature in Kelvin: %4.2f, Celcius: %4.2f, Farenheit %4.2f\n", k, c, f);
+            pc.printf("Humidity is %4.2f, Dewpoint: %4.2f, Dewpoint fast: %4.2f\n", h, dp, dpf);
         } else {
-            printf("Error: %d\n", error);
+            pc.printf("Error: %d\n", error);
         }
     }
 }