Mbed OS 5.x example, ranging with the VL53L1X Time-of-Flight (ToF) sensor on the X-NUCLEO-53L1A1 expansion board, and 2 VL53L1X Satellite boards, connected to the expansion board.
Dependencies: X_NUCLEO_53L1A1
Revision 6:e3857da4a7a5, committed 2021-05-12
- Comitter:
- johnAlexander
- Date:
- Wed May 12 10:05:25 2021 +0000
- Parent:
- 5:a00c309758b2
- Commit message:
- Rebuilt for MbedOS v5.15.7 & v6.10.0.
Changed in this revision
--- a/X_NUCLEO_53L1A1.lib Tue Nov 03 11:45:33 2020 +0000 +++ b/X_NUCLEO_53L1A1.lib Wed May 12 10:05:25 2021 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/ST/code/X_NUCLEO_53L1A1/#9e555217be6e +https://os.mbed.com/teams/ST/code/X_NUCLEO_53L1A1/#820c80ae7752
--- a/main.cpp Tue Nov 03 11:45:33 2020 +0000
+++ b/main.cpp Wed May 12 10:05:25 2021 +0000
@@ -21,18 +21,18 @@
* INT_L & INT_R positions; or
* U10 and U15 must be made/ON to allow interrupts to be received from the
* Alternate INT_L & INT_R positions.
- * The X_NUCLEO_53L1A1 firmware library defaults to use the INT_L/INT_R
- * positions.
- * INT_L is available on expansion board Arduino Connector CN5, pin 1 as D9.
- * Alternate INT_L is on CN5 Connector pin 2 as D8.
- * INT_R is available on expansion board Arduino Connector CN9, pin 3 as D4.
- * Alternate INT_R is on CN9 Connector pin 5 as D2.
+ * The X_NUCLEO_53L1A1 library defaults to use the INT_L/INT_R positions.
+ * INT_L is available on expansion board Arduino Connector CN5, pin 1 as D8.
+ * Alternate INT_L is on CN5 Connector pin 2 as D9.
+ * INT_R is available on expansion board Arduino Connector CN9, pin 3 as D2.
+ * Alternate INT_R is on CN9 Connector pin 5 as D4.
* The pinouts are shown here : https://developer.mbed.org/components/X-NUCLEO-53L1A1/
*/
#include <stdio.h>
#include "mbed.h"
+
#include "XNucleo53L1A1.h"
#include "VL53L1X_I2C.h"
@@ -40,7 +40,7 @@
#define VL53L1_I2C_SCL D15
#if TARGET_STM // we are cross compiling for an STM32-Nucleo
- InterruptIn stop_button(USER_BUTTON);
+ InterruptIn stop_button(BUTTON1);
#endif
#if TARGET_Freescale // we are cross-compiling for NXP FRDM boards.
InterruptIn stop_button(SW2);
@@ -53,6 +53,12 @@
char installedSensors[3];
static XNucleo53L1A1 *board=NULL;
+#if (MBED_VERSION > 60300)
+UnbufferedSerial pc(USBTX, USBRX);
+extern "C" void wait_ms(int ms);
+#else
+Serial pc(SERIAL_TX, SERIAL_RX);
+#endif
/* interrupt requests */
volatile bool centerSensor = false;
@@ -238,3 +244,9 @@
return 0;
}
+#if (MBED_VERSION > 60300)
+extern "C" void wait_ms(int ms)
+{
+ thread_sleep_for(ms);
+}
+#endif
--- a/mbed-os.lib Tue Nov 03 11:45:33 2020 +0000 +++ b/mbed-os.lib Wed May 12 10:05:25 2021 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#bacf37894945a5c9b7619b709eeabeeb68d25d9c +https://github.com/ARMmbed/mbed-os/#9738b27c7df897c29e9769911d6794ba3e5b3f19