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_53L1A2
Diff: main.cpp
- Revision:
- 4:d50740df0184
- Parent:
- 3:6ecc831dc9fa
- Child:
- 5:6caa39f97aad
--- a/main.cpp Fri May 07 10:11:09 2021 +0000
+++ b/main.cpp Fri May 07 13:48:27 2021 +0000
@@ -1,13 +1,19 @@
/*
- * This VL53L1CB Expansion board test application performs range measurements
- * using the onboard embedded centre sensor, in singleshot, polling mode.
- * Measured ranges are ouput on the Serial Port, running at 115200 baud.
- *
+ * This VL53L1CB Expansion board test application performs range measurements
+ * using the onboard embedded centre sensor, in singleshot, polling mode.
+ * Measured ranges are ouput on the Serial Port, running at 115200 baud.
*
* This is designed to work with MBed V2 , MBed V5 and MBed V6.
*
+ * The Reset button can be used to restart the program.
*
- * The Reset button can be used to restart the program.
+ *
+ * *** Note :
+ * Default Mbed build system settings disable print floating-point support.
+ * Offline builds can enable this, again.
+ * https://github.com/ARMmbed/mbed-os/blob/master/platform/source/minimal-printf/README.md
+ * .\mbed-os\platform\mbed_lib.json
+ *
*/
#include <stdio.h>
@@ -193,11 +199,8 @@
current_time_ms = us_ticker_read() / 1000;
if((status==0) && (RangingData.RangeStatus != 10)) {
-// printf("data %d,%d,%d,%2.2f,%2.2f\n", ToFSensor, RangingData.RangeStatus, RangingData.RangeMilliMeter,
-// (RangingData.SignalRateRtnMegaCps/65536.0), RangingData.AmbientRateRtnMegaCps/65336.0);
- printf("data %d, %d, %d, %.2f, %.2f\n", ToFSensor, RangingData.RangeStatus, RangingData.RangeMilliMeter,
- (RangingData.SignalRateRtnMegaCps/65336.0), (RangingData.AmbientRateRtnMegaCps/65336.0));
-
+ printf("data %d,%d,%d,%2.2f,%2.2f\n", ToFSensor, RangingData.RangeStatus, RangingData.RangeMilliMeter,
+ (RangingData.SignalRateRtnMegaCps/65536.0), RangingData.AmbientRateRtnMegaCps/65336.0);
}
} // if status
else
@@ -213,8 +216,6 @@
polling_time_ms = current_time_ms - start_time_ms;
if((status==0) && (RangingData.RangeStatus != 10)) {
-// printf("data %d,%d,%d,%2.2f,%2.2f %d\n", ToFSensor, RangingData.RangeStatus, RangingData.RangeMilliMeter,
-// (RangingData.SignalRateRtnMegaCps/65536.0), (RangingData.AmbientRateRtnMegaCps/65336.0), polling_time_ms);
signalRate = RangingData.SignalRateRtnMegaCps / 65535.0;
ambientRate = RangingData.AmbientRateRtnMegaCps / 65535.0;
printf("data %d, %d, %d, %2.2f, %2.2f, %d\n", ToFSensor, RangingData.RangeStatus, RangingData.RangeMilliMeter,