Simple demo of VL6180x explorer shield with Nucleo F401 based on work by SparkFun.

Dependencies:   VL6180x mbed

Simple demo program for Nucleo VL6180 Explorer shield from ST mounted on Nucleo F401. Based on work from SparkFun Electronics.

Shows basic function of Ambient Light Sensor and Time of Flight Distance sensor. Values readable over standard serial port.

Revision:
3:0ac797e55e49
Parent:
2:3de053b7541f
--- a/main.cpp	Fri Jun 17 17:13:35 2016 +0000
+++ b/main.cpp	Fri Jun 17 17:31:48 2016 +0000
@@ -71,7 +71,7 @@
 }
 
 int main() {
-
+  uint8_t retaddr;
   wait_ms(100); // delay .1s
 
   sensor.getIdentification(&identification); // Retrieve manufacture info from device memory
@@ -91,7 +91,8 @@
   wait_ms(1000); // delay 1s
   //
   printf("Change sensor address to 0x27\n");
-  sensor.changeAddress(0x29,0x27);
+  retaddr=sensor.changeAddress(0x29,0x27);
+  printf("Sensor addres is now %x\n",retaddr);
   sensor.getIdentification(&identification); // Retrieve manufacture info from device memory
   printIdentification(&identification); // Helper function to print all the Module information
   printf("Ambient Light Level (Lux) = ");
@@ -99,7 +100,8 @@
   
   wait_ms(1000); // delay 1s
   printf("Change sensor address back to 0x29\n");
-  sensor.changeAddress(0x27,0x29);
+  retaddr=sensor.changeAddress(0x27,0x29);
+  printf("Sensor addres is now %x\n",retaddr);
   sensor.getIdentification(&identification); // Retrieve manufacture info from device memory
   printIdentification(&identification); // Helper function to print all the Module information
   printf("Ambient Light Level (Lux) = ");