Second demo with X-NUCLEO-53L1A1.
Dependencies: X_NUCLEO_53L1A1 X_NUCLEO_IKS01A3
Revision 3:d90f22c17d0c, committed 2020-11-02
- Comitter:
- johnAlexander
- Date:
- Mon Nov 02 16:17:21 2020 +0000
- Parent:
- 2:819f8323b02d
- Child:
- 4:ae2069fd545c
- Commit message:
- Update to use ST board class, and mbed sensor class.
Changed in this revision
| X_NUCLEO_53L1A1_mbed.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/X_NUCLEO_53L1A1_mbed.lib Mon Oct 14 10:02:40 2019 +0000 +++ b/X_NUCLEO_53L1A1_mbed.lib Mon Nov 02 16:17:21 2020 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/ST-Expansion-SW-Team/code/X_NUCLEO_53L1A1_mbed/#24a73ef7469f +https://os.mbed.com/teams/ST/code/X_NUCLEO_53L1A1_mbed/#b3aa04ca507c
--- a/main.cpp Mon Oct 14 10:02:40 2019 +0000
+++ b/main.cpp Mon Nov 02 16:17:21 2020 +0000
@@ -27,7 +27,7 @@
#include "mbed.h"
#include "XNucleo53L1A1.h"
-#include "vl53L1x_I2c.h"
+#include "VL53L1X_I2C.h"
#define VL53L1_I2C_SDA D14
#define VL53L1_I2C_SCL D15
@@ -55,7 +55,7 @@
printf("Hello world!\r\n");
- vl53L1X_DevI2C *dev_I2C = new vl53L1X_DevI2C(VL53L1_I2C_SDA, VL53L1_I2C_SCL);
+ VL53L1X_DevI2C *dev_I2C = new VL53L1X_DevI2C(VL53L1_I2C_SDA, VL53L1_I2C_SCL);
printf("I2C device created!\r\n");
@@ -74,7 +74,7 @@
/* Start ranging on the centre sensor */
if (board->sensor_centre != NULL) {
- status = board->sensor_centre->VL53L1X_StartRanging();
+ status = board->sensor_centre->vl53l1x_start_ranging();
if (status != 0) {
printf("Centre sensor failed to start ranging!\r\n");
return status;
@@ -83,7 +83,7 @@
/* Start ranging on the left sensor */
if (board->sensor_left != NULL) {
- status = board->sensor_left->VL53L1X_StartRanging();
+ status = board->sensor_left->vl53l1x_start_ranging();
if (status != 0) {
printf("Left sensor failed to start ranging!\r\n");
return status;
@@ -92,7 +92,7 @@
/* Start ranging on the right sensor */
if (board->sensor_right != NULL) {
- status = board->sensor_right->VL53L1X_StartRanging();
+ status = board->sensor_right->vl53l1x_start_ranging();
if (status != 0) {
printf("Right sensor failed to start ranging!\r\n");
return status;
@@ -110,25 +110,25 @@
break;
}
if (board->sensor_centre != NULL) {
- board->sensor_centre->VL53L1X_CheckForDataReady(&ready_centre);
+ board->sensor_centre->vl53l1x_check_for_data_ready(&ready_centre);
}
if (board->sensor_left != NULL) {
- board->sensor_left->VL53L1X_CheckForDataReady(&ready_left);
+ board->sensor_left->vl53l1x_check_for_data_ready(&ready_left);
}
if (board->sensor_right != NULL) {
- board->sensor_right->VL53L1X_CheckForDataReady(&ready_right);
+ board->sensor_right->vl53l1x_check_for_data_ready(&ready_right);
}
if (ready_centre) {
- board->sensor_centre->VL53L1X_GetRangeStatus(&ready_centre);
- board->sensor_centre->VL53L1X_GetDistance(&distance_centre);
+ board->sensor_centre->vl53l1x_get_range_status(&ready_centre);
+ board->sensor_centre->vl53l1x_get_distance(&distance_centre);
}
if (ready_left) {
- board->sensor_left->VL53L1X_GetRangeStatus(&ready_left);
- board->sensor_left->VL53L1X_GetDistance(&distance_left);
+ board->sensor_left->vl53l1x_get_range_status(&ready_left);
+ board->sensor_left->vl53l1x_get_distance(&distance_left);
}
if (ready_right) {
- board->sensor_right->VL53L1X_GetRangeStatus(&ready_right);
- board->sensor_right->VL53L1X_GetDistance(&distance_right);
+ board->sensor_right->vl53l1x_get_range_status(&ready_right);
+ board->sensor_right->vl53l1x_get_distance(&distance_right);
}
if (board->sensor_centre != NULL) {