28_3

Dependencies:   DHT mbed

Files at this revision

API Documentation at this revision

Comitter:
Niranjan_ravi
Date:
Thu Mar 29 04:37:35 2018 +0000
Commit message:
Niranjan_28_March_TemperatureCode

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 53fb25e6315f DHT.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT.lib	Thu Mar 29 04:37:35 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Wimpie/code/DHT/#9b5b3200688f
diff -r 000000000000 -r 53fb25e6315f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Mar 29 04:37:35 2018 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+#include "DHT.h"
+
+DHT sensor(PTC16, AM2302); 
+DigitalOut gpio1(PTB9); 
+int main()
+{
+   int error;
+    float farenheit = 0.0f;
+    while(1)
+     {
+        wait(4);
+       error = sensor.readData();
+       farenheit   = sensor.ReadTemperature(FARENHEIT);
+       printf("%f\n\r",farenheit);
+          if (  farenheit > 80 )
+             {
+                gpio1 = 1;
+                printf(" start and gpio is 1 \n");
+             }
+             else if ( farenheit >= 73 and farenheit < 80 )
+             {
+                gpio1= 0;
+                printf(" stop  and gpio is 0 \n");
+             }
+    }   
+}
\ No newline at end of file
diff -r 000000000000 -r 53fb25e6315f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 29 04:37:35 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/aa5281ff4a02
\ No newline at end of file