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

Files at this revision

API Documentation at this revision

Comitter:
charlesmn
Date:
Mon Nov 09 17:59:08 2020 +0000
Parent:
1:6bbe4976bc7b
Commit message:
No functional change. Changed Filenames and functions names to be VL53L1

Changed in this revision

X_NUCLEO_53L1A2.lib Show annotated file Show diff for this revision Revisions of this file
X_NUCLEO_53L1CB.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/X_NUCLEO_53L1A2.lib	Mon Nov 09 17:59:08 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/ST-Expansion-SW-Team/code/X_NUCLEO_53L1A2/#25be5ff92db5
--- a/X_NUCLEO_53L1CB.lib	Sun Nov 08 18:09:34 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/teams/ST-Expansion-SW-Team/code/X_NUCLEO_53L1CB/#ac8e3765ece8
--- 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");