Ian Kilburn / Mbed 2 deprecated VL6180X_Explorer

Dependencies:   VL6180x mbed

Files at this revision

API Documentation at this revision

Comitter:
highroads
Date:
Fri Jun 17 17:31:48 2016 +0000
Parent:
2:3de053b7541f
Commit message:
Print out current address

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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) = ");