VL53L1CB ranging example, using embedded sensor on X-Nucleo-53L1A2 expansion board, in interrupt mode.
Dependencies: X_NUCLEO_53L1A2
Diff: main.cpp
- Revision:
- 1:ff48a20de191
- Parent:
- 0:020912dfa221
- Child:
- 2:f0ec92af4b5f
--- a/main.cpp Sun Nov 08 15:35:55 2020 +0000 +++ b/main.cpp Mon Nov 09 17:36:20 2020 +0000 @@ -13,7 +13,7 @@ #include <stdio.h> #include "mbed.h" -#include "XNucleo53L1A1.h" +#include "XNucleo53L1A2.h" #include "ToF_I2C.h" #include <time.h> @@ -24,6 +24,7 @@ #define NUM_SENSORS 3 +// define the interrupt pins PinName CentreIntPin = A2; // the satellite pins depend on solder blobs on the back of the shield. // they may not exist or may be one of two sets. @@ -36,7 +37,7 @@ -static XNucleo53L1A1 *board=NULL; +static XNucleo53L1A2 *board=NULL; // MBed V6.4 has renamed wait_ms and UnbufferedSerial replaces Serial #if (MBED_VERSION > 60300) @@ -139,7 +140,7 @@ int main() { int status; - VL53L1X * Sensor; + VL53L1 * Sensor; uint8_t ToFSensor = 1; // 0=Left, 1=Center(default), 2=Right //mbed compiler claims these are never used but they are. @@ -157,8 +158,8 @@ dev_I2C->frequency(400000); //also needs doing in spi_interface.c - /* creates the 53L1A1 expansion board singleton obj */ - board = XNucleo53L1A1::instance(dev_I2C, CentreIntPin, LeftIntPin, RightIntPin); + /* creates the 53L1A2 expansion board singleton obj */ + board = XNucleo53L1A2::instance(dev_I2C, CentreIntPin, LeftIntPin, RightIntPin); printf("board created!\r\n");