Hand Gesture recognition (L-R swipe) application based on L-R sensors.
Dependencies: X_NUCLEO_53L0A1 mbed
Fork of 53L0A1_HandGestureRecognition by
Revision 8:8151f9abad18, committed 2017-12-18
- Comitter:
- mapellil
- Date:
- Mon Dec 18 09:59:00 2017 +0000
- Parent:
- 7:d79cbeda2982
- Commit message:
- Updated libs
Changed in this revision
X_NUCLEO_53L0A1.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 |
diff -r d79cbeda2982 -r 8151f9abad18 X_NUCLEO_53L0A1.lib --- a/X_NUCLEO_53L0A1.lib Fri Dec 15 14:16:16 2017 +0000 +++ b/X_NUCLEO_53L0A1.lib Mon Dec 18 09:59:00 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/ST/code/X_NUCLEO_53L0A1/#cb95ef8a3508 +https://os.mbed.com/teams/ST/code/X_NUCLEO_53L0A1/#99c367e8a402
diff -r d79cbeda2982 -r 8151f9abad18 main.cpp --- a/main.cpp Fri Dec 15 14:16:16 2017 +0000 +++ b/main.cpp Mon Dec 18 09:59:00 2017 +0000 @@ -1,5 +1,5 @@ #include "mbed.h" -#include "x_nucleo_53l0a1.h" +#include "XNucleo53L0A1.h" #include "tof_gestures_DIRSWIPE_1.h" #include "tof_gestures.h" #include <string.h> @@ -45,7 +45,7 @@ InterruptIn stop_button(USER_BUTTON); #endif -static X_NUCLEO_53L0A1 *board = NULL; +static XNucleo53L0A1 *board = NULL; VL53L0X_RangingMeasurementData_t data_sensor; VL53L0X_RangingMeasurementData_t data_sensor_l; VL53L0X_RangingMeasurementData_t data_sensor_r; @@ -136,19 +136,19 @@ sl=0; sr=0; // start single range measure - status = board->sensor_left->vl53l0x_start_measurement(dev_l); + status = board->sensor_left->VL53L0X_start_measurement(dev_l); if (status != 0) printf ("ERROR line: %d\n\r",__LINE__); - status = board->sensor_right->vl53l0x_start_measurement(dev_r); + status = board->sensor_right->VL53L0X_start_measurement(dev_r); if (status != 0) printf ("ERROR line: %d\n\r",__LINE__); for (;meas_ready_r==0 && meas_ready_l==0;) { - status = board->sensor_left->vl53l0x_get_measurement_data_ready(dev_l, &measurement_data_ready); + status = board->sensor_left->VL53L0X_get_measurement_data_ready(dev_l, &measurement_data_ready); if (status != 0) printf ("ERROR line: %d\n\r",__LINE__); if (measurement_data_ready ==1 && status ==0 ) { sl=1; - board->sensor_left->vl53l0x_get_ranging_measurement_data(dev_l, &ranging_measurement_data_l); - board->sensor_left->vl53l0x_clear_interrupt_mask(dev_l, 0); + board->sensor_left->VL53L0X_get_ranging_measurement_data(dev_l, &ranging_measurement_data_l); + board->sensor_left->VL53L0X_clear_interrupt_mask(dev_l, 0); // printf ("L = %d\n\r", ranging_measurement_data_l.RangeMilliMeter); meas_ready_l = 1; leftRange = ranging_measurement_data_l.RangeMilliMeter; @@ -159,12 +159,12 @@ ranging_measurement_data_l.RangeMilliMeter = 1200; } - status = board->sensor_right->vl53l0x_get_measurement_data_ready(dev_r, &measurement_data_ready); + status = board->sensor_right->VL53L0X_get_measurement_data_ready(dev_r, &measurement_data_ready); if (status != 0) printf ("ERROR line: %d\n\r",__LINE__); if (measurement_data_ready ==1 && status ==0 ) { sr=1; - board->sensor_right->vl53l0x_get_ranging_measurement_data(dev_r, &ranging_measurement_data_r); - board->sensor_right->vl53l0x_clear_interrupt_mask(dev_r, 0); + board->sensor_right->VL53L0X_get_ranging_measurement_data(dev_r, &ranging_measurement_data_r); + board->sensor_right->VL53L0X_clear_interrupt_mask(dev_r, 0); // printf ("R = %d\n\r", ranging_measurement_data_r.RangeMilliMeter); meas_ready_r = 1; rightRange = ranging_measurement_data_r.RangeMilliMeter; @@ -205,8 +205,8 @@ VL53L0X_DEV dev_l; board->sensor_left->vl53l0x_get_device(&dev_l); uint8_t vhv_settings, phase_cal; - board->sensor_left->vl53l0x_perform_ref_calibration(dev_l, &vhv_settings, &phase_cal); - board->sensor_left->vl53l0x_set_measurement_timing_budget_micro_seconds(dev_l, 20000); + board->sensor_left->VL53L0X_perform_ref_calibration(dev_l, &vhv_settings, &phase_cal); + board->sensor_left->VL53L0X_set_measurement_timing_budget_micro_seconds(dev_l, 20000); ++sensorCnt; } @@ -216,8 +216,8 @@ VL53L0X_DEV dev_r; board->sensor_right->vl53l0x_get_device(&dev_r); uint8_t vhv_settings, phase_cal; - board->sensor_right->vl53l0x_perform_ref_calibration(dev_r, &vhv_settings, &phase_cal); - board->sensor_right->vl53l0x_set_measurement_timing_budget_micro_seconds(dev_r, 20000); + board->sensor_right->VL53L0X_perform_ref_calibration(dev_r, &vhv_settings, &phase_cal); + board->sensor_right->VL53L0X_set_measurement_timing_budget_micro_seconds(dev_r, 20000); ++sensorCnt; } currentSensor = 0; @@ -230,7 +230,7 @@ int status; /* creates the 53L0A1 expansion board singleton obj */ - board = X_NUCLEO_53L0A1::instance(device_i2c, A2, D8, D2); + board = XNucleo53L0A1::instance(device_i2c, A2, D8, D2); //board=X_NUCLEO_53L0A1::instance(device_i2c, A2, D9, D4); // Alternate INT_L/INT_R settings. board->display->display_string("53L0");