GY-30 for L053R8.

Dependencies:   BH1750 mbed

Files at this revision

API Documentation at this revision

Comitter:
sp036239
Date:
Thu Sep 14 01:22:08 2017 +0000
Commit message:
Nucleo_L053R8_GY30

Changed in this revision

BH1750.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 765a67fb3724 BH1750.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BH1750.lib	Thu Sep 14 01:22:08 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/vrabec/code/BH1750/#58ee8a917618
diff -r 000000000000 -r 765a67fb3724 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 14 01:22:08 2017 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "BH1750.h"
+
+
+DigitalOut myled(LED1);
+BH1750 myGY30(D14,D15);
+Serial pc(SERIAL_TX, SERIAL_RX);
+
+int main() {
+    myGY30.init();
+    if(myGY30.getStatus()==0){
+        pc.printf("GY-30 initialized...\r\n");
+        while(1) {
+            myled = !myled;
+            pc.printf("%8.5f\r\n",myGY30.readIntesity());
+            wait(0.2); // 200 ms
+        }
+    }else{
+        myGY30.init();
+    }
+}
diff -r 000000000000 -r 765a67fb3724 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Sep 14 01:22:08 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec
\ No newline at end of file