@@ -266,21 +266,24 @@ void setup() {
266266
267267 // Create VL53L0X top component.
268268 xshutdown_top = new STMPE1600DigiOut (&DEV_I2C, GPIO_15, (0x42 * 2 ));
269- sensor_vl53l0x_top = new VL53L0X_X_NUCLEO_53L0A1 (&DEV_I2C, xshutdown_top, A2);
269+ sensor_vl53l0x_top = new VL53L0X_X_NUCLEO_53L0A1 (&DEV_I2C, xshutdown_top);
270+ sensor_vl53l0x_top->begin ();
270271
271272 // Switch off VL53L0X top component.
272273 sensor_vl53l0x_top->VL53L0X_Off ();
273274
274275 // Create VL53L0X left component.
275276 xshutdown_left = new STMPE1600DigiOut (&DEV_I2C, GPIO_14, (0x43 * 2 ));
276- sensor_vl53l0x_left = new VL53L0X_X_NUCLEO_53L0A1 (&DEV_I2C, xshutdown_left, D8);
277+ sensor_vl53l0x_left = new VL53L0X_X_NUCLEO_53L0A1 (&DEV_I2C, xshutdown_left);
278+ sensor_vl53l0x_left->begin ();
277279
278280 // Switch off VL53L0X left component.
279281 sensor_vl53l0x_left->VL53L0X_Off ();
280282
281283 // Create VL53L0X right component.
282284 xshutdown_right = new STMPE1600DigiOut (&DEV_I2C, GPIO_15, (0x43 * 2 ));
283- sensor_vl53l0x_right = new VL53L0X_X_NUCLEO_53L0A1 (&DEV_I2C, xshutdown_right, D2);
285+ sensor_vl53l0x_right = new VL53L0X_X_NUCLEO_53L0A1 (&DEV_I2C, xshutdown_right);
286+ sensor_vl53l0x_right->begin ();
284287
285288 // Switch off VL53L0X right component.
286289 sensor_vl53l0x_right->VL53L0X_Off ();
0 commit comments