sr501/BH1750/mq-2/dht11

Dependencies:   mbed

Fork of sensors_2 by w mx

Revision:
1:1197997ae0ea
Child:
2:cd0ea77c7d66
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example.cpp	Wed Sep 12 15:51:26 2018 +0000
@@ -0,0 +1,35 @@
+#include "sensors.h"
+#include "mbed.h"
+
+Serial usb2pc(PA_2, PA_3, 9600);  
+DigitalOut myled(PC_13);
+
+int main()
+{
+
+    
+    usb2pc.printf("starting\r\n");
+    sr501 x(PB_1);
+    BH1750 y(PB_7,PB_6);
+    
+    while(1)
+    {
+        /*
+        if(x.operator ==(true))
+        {
+            usb2pc.printf("get\r\n");
+            while(x.read()){usb2pc.printf("aaaaaaaaaaaaa\r\n");wait(0.1);myled=1;}
+            x.reset();
+        }
+        
+        else
+        {
+            usb2pc.printf("no\r\n");
+        }
+        wait(0.1);
+        */
+        
+        float light=y.getlightdata();
+        usb2pc.printf("Light intensity: %.4f Lux\r\n",light);
+    }
+}
\ No newline at end of file