check program for VL53L0X_simple library
Dependencies: VL53L0X_simple TextLCD
Please refer below page.
/users/kenjiArai/notebook/vl53l0x-tof-sensor/
Diff: main.cpp
- Revision:
- 4:325021757859
- Parent:
- 3:1be17b18b200
--- a/main.cpp Mon Feb 24 11:22:18 2020 +0000 +++ b/main.cpp Wed Feb 26 09:37:49 2020 +0000 @@ -26,7 +26,7 @@ * https://os.mbed.com/users/kenjiArai/ * Created: January 21st, 2018 * Revised: Feburary 6th, 2018 (with updated VL53L0X_simple library) - * Revised: Feburary 24th, 2020 only run on mbed-os5.15.1 + * Revised: Feburary 26th, 2020 only run on mbed-os5.15.1 */ // Include -------------------------------------------------------------------- @@ -54,7 +54,13 @@ //I2C i2c(P0_30, P0_7); // only for TY51822r3 //I2C i2c(I2C_SDA, I2C_SCL); // standard I2C i2c(D14, D15); -VL53L0X sensor(i2c, D8); // XSHUT = D8 (or NC) +#if USE_XSHUT +VL53L0X sensor(i2c, D8); +#else +VL53L0X sensor(i2c, NC); +//VL53L0X sensor(I2C_SDA, I2C_SCL, NC); +//VL53L0X sensor(D14, D15, NC); +#endif #if USE_LCD TextLCD_I2C_N lcd(&i2c, 0x7c, TextLCD::LCD8x2); // LCD(Akizuki AQM0802A) #endif