A sample program getting measurements from a VL53L1 ToF sensor which is directly connected to the STM32F401. Only copes with one sensor. Polls for measurements. VL53L1 is operated in multizone mode. MBed V6.3 but will work with other MBed versions.

Dependencies:   X_NUCLEO_53L1A2

Revision:
2:014f6e21d7b3
Parent:
1:6bbe4976bc7b
--- a/main.cpp	Sun Nov 08 18:09:34 2020 +0000
+++ b/main.cpp	Mon Nov 09 17:59:08 2020 +0000
@@ -19,7 +19,7 @@
 //#include "vl53lx_class.h"
 #include "vl53l1_def.h"
 #include "vl53l1_platform_user_data.h"
-#include "vl53l1x.h"
+#include "vl53l1.h"
 
 
 // define the i2c comms pins
@@ -58,7 +58,7 @@
 int main()
 {   
     int status;
-    VL53L1X * Sensor;
+    VL53L1 * Sensor;
     uint16_t wordData;
     DigitalOut xshutdown(D9);
 
@@ -72,7 +72,7 @@
     /* creates the 53L1A1 expansion board singleton obj */
 //   board = XNucleo51L1::instance(dev_I2C, A2, D8, D2);
    
-   Sensor = new VL53L1X(dev_I2C,&xshutdown,A2);
+   Sensor = new VL53L1(dev_I2C,&xshutdown,A2);
     
     printf("board created!\r\n");