Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_53L1A1_mbed
Revision 2:819f8323b02d, committed 2019-10-14
- Comitter:
- johnAlexander
- Date:
- Mon Oct 14 10:02:40 2019 +0000
- Parent:
- 1:b7507ca3370f
- Commit message:
- Simple ranging example, using polling, with expansion board sensor and satellite boards.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b7507ca3370f -r 819f8323b02d main.cpp
--- a/main.cpp Thu May 23 13:00:36 2019 +0000
+++ b/main.cpp Mon Oct 14 10:02:40 2019 +0000
@@ -1,11 +1,8 @@
/*
* This VL53L1X Expansion board test application performs range measurements
- * using the onboard embedded centre sensor.
+ * using the onboard embedded centre sensor, and 2 Satellite boards.
*
- * Measured ranges are ouput on the Serial Port, running at 96000 baud.
- *
- * The User Blue button stops the current measurement and entire program,
- * releasing all resources.
+ * Measured ranges are ouput on the Serial Port, running at 115200 baud.
*
* The Black Reset button is used to restart the program.
*
@@ -36,7 +33,6 @@
#define VL53L1_I2C_SCL D15
static XNucleo53L1A1 *board=NULL;
-Serial pc(SERIAL_TX, SERIAL_RX);
volatile bool polling_stop = false;
@@ -49,10 +45,6 @@
=============================================================================*/
int main()
{
-#if USER_BUTTON==PC_13 // we are cross compiling for Nucleo-f401
- InterruptIn stop_button(USER_BUTTON);
- stop_button.rise(&stop_polling);
-#endif
int status = 0;
uint8_t ready_centre = 0;
uint8_t ready_left = 0;
@@ -140,13 +132,13 @@
}
if (board->sensor_centre != NULL) {
- printf("%d\t", distance_centre);
+ printf("Distance read by centre sensor is : %d\r\n", distance_centre);
}
if (board->sensor_left != NULL) {
- printf("%d\t", distance_left);
+ printf("Distance read by left satellite sensor is : %d\r\n", distance_left);
}
if (board->sensor_right != NULL) {
- printf("%d\t", distance_right);
+ printf("Distance read by right satellite sensor is : %d\r\n", distance_right);
}
}