Simple HelloWorld program for the VL53L0X LIDAR sensor.
Dependencies: X_NUCLEO_53L0A1 mbed
Fork of HelloWorld_53L0A1 by
Revision 6:e59621ce59ea, committed 2017-04-30
- Comitter:
- huck1137
- Date:
- Sun Apr 30 22:47:40 2017 +0000
- Parent:
- 5:029d3e5b117d
- Commit message:
- ;
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 |
--- a/X_NUCLEO_53L0A1.lib Tue Dec 06 14:04:46 2016 +0000 +++ b/X_NUCLEO_53L0A1.lib Sun Apr 30 22:47:40 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/ST/code/X_NUCLEO_53L0A1/#35ecf3e060c3 +https://developer.mbed.org/users/huck1137/code/X_NUCLEO_53L0A1/#61011b4c9fc3
--- a/main.cpp Tue Dec 06 14:04:46 2016 +0000
+++ b/main.cpp Sun Apr 30 22:47:40 2017 +0000
@@ -11,6 +11,11 @@
static X_NUCLEO_53L0A1 *board=NULL;
+//VIN -- VOUT
+//GND -- GND
+//SDA -- p27
+//SCA -- p28
+
/*=================================== Main ==================================
=============================================================================*/
int main()
@@ -18,10 +23,10 @@
int status;
uint32_t distance;
- DevI2C *device_i2c =new DevI2C(VL53L0_I2C_SDA, VL53L0_I2C_SCL);
+ DevI2C *device_i2c =new DevI2C(p27, p28);
/* creates the 53L0A1 expansion board singleton obj */
- board=X_NUCLEO_53L0A1::Instance(device_i2c, A2, D8, D2);
+ board=X_NUCLEO_53L0A1::Instance(device_i2c,p21,p21,p21);
/* init the 53L0A1 expansion board with default values */
status=board->InitBoard();
@@ -31,7 +36,7 @@
{
status = board->sensor_centre->GetDistance(&distance);
if (status == VL53L0X_ERROR_NONE)
- printf("Distance : %ld\n", distance);
+ printf("Distance : %ldmm\n", distance);
}
}
