yoshikawa kyoto

Dependencies:   S11059-SoftI2C VL6180 m3pi mbed

Fork of VL6180_Hello_World by Steven Burg

Files at this revision

API Documentation at this revision

Comitter:
tennisbaca
Date:
Tue Jul 19 00:53:45 2016 +0000
Parent:
0:2508f38e90fe
Commit message:
yoshi

Changed in this revision

S11059-SoftI2C.lib Show annotated file Show diff for this revision Revisions of this file
VL6180.lib Show annotated file Show diff for this revision Revisions of this file
m3pi.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/S11059-SoftI2C.lib	Tue Jul 19 00:53:45 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/maruta/code/S11059-SoftI2C/#ea48b39e69bd
--- a/VL6180.lib	Mon Oct 19 16:47:41 2015 +0000
+++ b/VL6180.lib	Tue Jul 19 00:53:45 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/sburg/code/VL6180/#595673e4c505
+https://developer.mbed.org/users/sburg/code/VL6180/#5d61f202b1bd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m3pi.lib	Tue Jul 19 00:53:45 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/chris/code/m3pi/#4b7d6ea9b35b
--- a/main.cpp	Mon Oct 19 16:47:41 2015 +0000
+++ b/main.cpp	Tue Jul 19 00:53:45 2016 +0000
@@ -1,14 +1,42 @@
 #include "VL6180.h"
 #include "mbed.h"
+#include "m3pi.h"
+#include "S11059-SoftI2C.h"
 
-VL6180 rf(p9, p10); //I2C sda and scl
+VL6180 rf(p28, p27); //I2C sda and scl
 Serial pc(USBTX, USBRX); //USB serial
+S11059 col(p19,p20);
+m3pi m3pi;
+Timer t;
 
 int main() {
+    m3pi.cls();
+    m3pi.locate(0,0);
+    m3pi.printf("Sensor");
+    m3pi.locate(0,1);
+    m3pi.printf("Check");
+    wait(1);
     float reading;
+    float time[2];
+    int bl=0;
+    char buf[255];
+    
+    m3pi.cls();
     while(1) {
+        m3pi.cls();
+        t.start();
+        time[0] = t.read();
         reading = rf;
-        pc.printf("Read %4.1f cm\n", reading);
-        wait(0.5);
+        t.stop();
+        time[1] = t.read();
+        
+           
+        int len = 0;
+        //m3pi.locate(0,0);     
+        //len = sprintf(buf,"%f",reading);
+        m3pi.locate(0,1);
+        m3pi.printf("%f",time[1]-time[0]);
+        pc.printf("Read %4.1f cm\n\r", reading);
+        m3pi.print(buf,len);
     }
 }
\ No newline at end of file
--- a/mbed.bld	Mon Oct 19 16:47:41 2015 +0000
+++ b/mbed.bld	Tue Jul 19 00:53:45 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file