Skip to content

Commit 6caefbb

Browse files
authored
Update NucleoCar.ino
Update sensor APIs
1 parent fad0c13 commit 6caefbb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/NucleoCar/NucleoCar.ino

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,21 +586,24 @@ void setup() {
586586

587587
// Create VL6180X top component.
588588
gpio0_top = new STMPE1600DigiOut(&DEV_I2C, GPIO_12);
589-
sensor_vl6180x_top = new VL6180X_X_NUCLEO_6180XA1(&DEV_I2C, gpio0_top, 0);
589+
sensor_vl6180x_top = new VL6180X_X_NUCLEO_6180XA1(&DEV_I2C, gpio0_top);
590+
sensor_vl6180x_top->begin();
590591

591592
// Switch off VL6180X top component.
592593
sensor_vl6180x_top->VL6180x_Off();
593594

594595
// Create (if present) VL6180X left component.
595596
gpio0_left = new STMPE1600DigiOut(&DEV_I2C, GPIO_14);
596-
sensor_vl6180x_left = new VL6180X_X_NUCLEO_6180XA1(&DEV_I2C, gpio0_left, 0);
597+
sensor_vl6180x_left = new VL6180X_X_NUCLEO_6180XA1(&DEV_I2C, gpio0_left);
598+
sensor_vl6180x_left->begin();
597599

598600
// Switch off (if present) VL6180X left component.
599601
sensor_vl6180x_left->VL6180x_Off();
600602

601603
// Create (if present) VL6180X right component.
602604
gpio0_right = new STMPE1600DigiOut(&DEV_I2C, GPIO_15);
603-
sensor_vl6180x_right = new VL6180X_X_NUCLEO_6180XA1(&DEV_I2C, gpio0_right, 0);
605+
sensor_vl6180x_right = new VL6180X_X_NUCLEO_6180XA1(&DEV_I2C, gpio0_right);
606+
sensor_vl6180x_right->begin();
604607

605608
// Switch off (if present) VL6180X right component.
606609
sensor_vl6180x_right->VL6180x_Off();

0 commit comments

Comments
 (0)