Simple HelloWorld program for the VL53L0X LIDAR sensor.

Dependencies:   X_NUCLEO_53L0A1 mbed

Fork of HelloWorld_53L0A1 by ST

Files at this revision

API Documentation at this revision

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
diff -r 029d3e5b117d -r e59621ce59ea X_NUCLEO_53L0A1.lib
--- 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
diff -r 029d3e5b117d -r e59621ce59ea main.cpp
--- 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);
    }
 
 }