Sample program that reads from 3 VL53L3 ToF sensors in interrupt mode and outputs the data to the serial port at 115200 baud. MBed V5.15
Dependencies: X_NUCLEO_53L3A2
Diff: main.cpp
- Revision:
- 3:d6e7cc8dc1d0
- Parent:
- 0:c77591fc308d
- Child:
- 4:79402ad13f5d
--- a/main.cpp Thu Oct 15 12:02:54 2020 +0000 +++ b/main.cpp Mon Oct 19 09:09:19 2020 +0000 @@ -13,17 +13,17 @@ #include <stdio.h> #include "mbed.h" -#include "XNucleo53L1A1.h" -#include "vl53L1x_I2c.h" +#include "XNucleo53LX.h" +#include "vl53L3_I2c.h" #include <time.h> -#define VL53L1_I2C_SDA D14 -#define VL53L1_I2C_SCL D15 +#define I2C_SDA D14 +#define I2C_SCL D15 #define MEASUREMENTTIMING 55 -static XNucleo53L1A1 *board=NULL; +static XNucleo53LX *board=NULL; Serial pc(SERIAL_TX, SERIAL_RX); static int int_centre_result = 0; @@ -117,12 +117,12 @@ printf("Hello world!\r\n"); - vl53L1X_DevI2C *dev_I2C = new vl53L1X_DevI2C(VL53L1_I2C_SDA, VL53L1_I2C_SCL); + vl53L3_DevI2C *dev_I2C = new vl53L3_DevI2C(I2C_SDA, I2C_SCL); // printf("I2C device created! %d %d\r\n",dev_I2C,*dev_I2C); /* creates the 53L1A1 expansion board singleton obj */ - board = XNucleo53L1A1::instance(dev_I2C, A2, D8, D2); + board = XNucleo53LX::instance(dev_I2C, A2, D8, D2); printf("board created!\r\n"); /* init the 53L1A1 expansion board with default values */