@@ -1087,21 +1087,24 @@ void setup()
10871087
10881088 // Create VL53L1X top component.
10891089 xshutdown_top = new STMPE1600DigiOut (&DEV_I2C, GPIO_15, (0x42 * 2 ));
1090- sensor_vl53l1_top = new VL53L1_X_NUCLEO_53L1A1 (&DEV_I2C, xshutdown_top, A2);
1090+ sensor_vl53l1_top = new VL53L1_X_NUCLEO_53L1A1 (&DEV_I2C, xshutdown_top);
1091+ sensor_vl53l1_top->begin ();
10911092
10921093 // Switch off VL53L1X top component.
10931094 sensor_vl53l1_top->VL53L1_Off ();
10941095
10951096 // Create (if present) VL53L1X left component.
10961097 xshutdown_left = new STMPE1600DigiOut (&DEV_I2C, GPIO_14, (0x43 * 2 ));
1097- sensor_vl53l1_left = new VL53L1_X_NUCLEO_53L1A1 (&DEV_I2C, xshutdown_left, D8);
1098+ sensor_vl53l1_left = new VL53L1_X_NUCLEO_53L1A1 (&DEV_I2C, xshutdown_left);
1099+ sensor_vl53l1_left->begin ();
10981100
10991101 // Switch off (if present) VL53L1X left component.
11001102 sensor_vl53l1_left->VL53L1_Off ();
11011103
11021104 // Create (if present) VL53L1X right component.
11031105 xshutdown_right = new STMPE1600DigiOut (&DEV_I2C, GPIO_15, (0x43 * 2 ));
1104- sensor_vl53l1_right = new VL53L1_X_NUCLEO_53L1A1 (&DEV_I2C, xshutdown_right, D2);
1106+ sensor_vl53l1_right = new VL53L1_X_NUCLEO_53L1A1 (&DEV_I2C, xshutdown_right);
1107+ sensor_vl53l1_right->begin ();
11051108
11061109 // Switch off (if present) VL53L1X right component.
11071110 sensor_vl53l1_right->VL53L1_Off ();
@@ -1137,21 +1140,28 @@ void setup()
11371140 Acc2 = new LIS2DW12Sensor (&DEV_I2C);
11381141 Mag = new LIS2MDLSensor (&DEV_I2C);
11391142 Temp = new STTS751Sensor (&DEV_I2C);
1143+ Temp->begin ();
11401144 Temp->Enable ();
1145+ Acc2->begin ();
11411146 Acc2->Enable_X ();
11421147#elif defined (USE_IKS01A2)
11431148 HumTemp = new HTS221Sensor (&DEV_I2C);
11441149 PressTemp = new LPS22HBSensor (&DEV_I2C);
11451150 AccGyr = new LSM6DSLSensor (&DEV_I2C);
11461151 Acc2 = new LSM303AGR_ACC_Sensor (&DEV_I2C);
11471152 Mag = new LSM303AGR_MAG_Sensor (&DEV_I2C);
1153+ Acc2->begin ();
11481154 Acc2->Enable ();
11491155#endif
1156+ HumTemp->begin ();
11501157 HumTemp->Enable ();
1158+ PressTemp->begin ();
11511159 PressTemp->Enable ();
1160+ AccGyr->begin ();
11521161 AccGyr->Enable_X ();
11531162 AccGyr->Set_X_ODR (4 .0f );
11541163 AccGyr->Enable_G ();
1164+ Mag->begin ();
11551165 Mag->Enable ();
11561166}
11571167
0 commit comments