kazushiro tanimoto
/
VL53L0A1-test
test
Fork of test by
Diff: main.cpp
- Revision:
- 6:bc6c3c8c9976
- Parent:
- 4:c8932fb926d6
- Child:
- 7:e30d35831e6c
--- a/main.cpp Tue Dec 06 14:04:46 2016 +0000 +++ b/main.cpp Tue Jan 31 07:52:13 2017 +0000 @@ -5,10 +5,11 @@ /* This VL53L0X Expansion board test application performs a range measurement in polling mode on the onboard embedded top sensor. */ -#define VL53L0_I2C_SDA D14 -#define VL53L0_I2C_SCL D15 +#define VL53L0_I2C_SDA D4 +#define VL53L0_I2C_SCL D5 static X_NUCLEO_53L0A1 *board=NULL; +Serial pc(USBTX, USBRX); /*=================================== Main ================================== @@ -17,6 +18,7 @@ { int status; uint32_t distance; + pc.baud(115200); DevI2C *device_i2c =new DevI2C(VL53L0_I2C_SDA, VL53L0_I2C_SCL); @@ -31,7 +33,7 @@ { status = board->sensor_centre->GetDistance(&distance); if (status == VL53L0X_ERROR_NONE) - printf("Distance : %ld\n", distance); + printf("%ld\n\r", distance); } }