Errors using I2C Mux with (2) ToF sensors and (2) IMUs

I’m having problems developing a sketch so that I may grab data using the following:

  • (1) IoT RedBoard ESP32 Development Board

  • (1) Qwiic Mux Breakout - 8 Channel (TCA9548A)

  • (2) Qwiic Distance Sensors (VL53L4CD)

  • (2) Micro 6DoF IMUs (ISM330DHCX)
  • I have successfully logged data using the following setups:

  • a single Distance Sensor with a single IMU daisy chained directly to the RedBoard

  • two Distance Sensors connected to the RedBoard via the Qwiic Mux Breakout
  • My problems arise when I attempt to add the two IMUs to the I2C Mux Breakout. I’ve made multiple attempts to solve the errors on my own, but I’m currently at a standstill and not sure what to do next.

    The code from my most recent attempt:

    #include <Wire.h>
    #include  <SparkFun_I2C_Mux_Arduino_Library.h>
    #include "SparkFun_VL53L1X.h"
    #include "SparkFun_ISM330DHCX.h"
    
    QWIICMUX myMux;
    SFEVL53L1X **distanceSensor;
    SparkFun_ISM330DHCX myISM;
    
    // Structs for X,Y,Z data
    sfe_ism_data_t accelData;
    sfe_ism_data_t gyroData;
    
    #define MUX_ADDR 0x70 //7-bit unshifted default I2C Address
    #define NUMBER_OF_SENSORS 4
    #define NUMBER_OF_TOF_SENSORS 2
    #define NUMBER_OF_IMU_SENSORS 2
    
    void setup()
    {
      Serial.begin(115200);
      Serial.println("Double ToF and IMU v03 Setup");
    
      Wire.begin();
    
       //Create set of pointers to the ToF class
      distanceSensor = new SFEVL53L1X *[NUMBER_OF_TOF_SENSORS];
    
      //Assign pointers to instances of the ToF class
      for (int x = 0; x < NUMBER_OF_TOF_SENSORS; x++)
        distanceSensor[x] = new SFEVL53L1X(Wire);
    
      if (myMux.begin() == false)
      {
        Serial.println("Mux not detected. Freezing...");
        while (1)
          ;
      }
      Serial.println("Mux detected");
    
      byte currentPortNumber = myMux.getPort();
      Serial.print("CurrentPort: ");
      Serial.println(currentPortNumber);  
    
      //Create set of pointers to the IMU class
      myISM = new SparkFun_ISM330DHCX *[NUMBER_OF_IMU_SENSORS];
    
      //Assign pointers to instances of the IMU class
      for (int x = 2; x < NUMBER_OF_IMU_SENSORS; x++)
        myISM[x] = new SparkFun_ISM330DHCX(Wire);
    
        if (myMux.begin() == false)
      {
        Serial.println("Mux not detected. Freezing...");
        while (1)
          ;
      }
      Serial.println("Mux detected");
    
      byte currentPortNumber = myMux.getPort();
      Serial.print("CurrentPort: ");
      Serial.println(currentPortNumber);
    
      //Initialize all the sensors
      bool initSuccess = true;
    
      for (byte x = 0; x < NUMBER_OF_TOF_SENSORS; x++)
      {
        myMux.setPort(x);
        if (distanceSensor[x]->begin() != 0) //Begin returns 0 on a good init
        {
          Serial.print("Sensor ");
          Serial.print(x);
          Serial.println(" did not begin! Check wiring");
          initSuccess = false;
        }
        else
        {
          //Configure each sensor
          distanceSensor[x]->setIntermeasurementPeriod(1000);
          distanceSensor[x]->setDistanceModeShort();
          distanceSensor[x]->startRanging(); //Write configuration bytes to initiate measurement
          Serial.print("Sensor ");
          Serial.print(x);
          Serial.println(" configured");
        }
      }
    
      for (byte x = 2; x < NUMBER_OF_IMU_SENSORS; x++)
      {
        myMux.setPort(x);
        if (myISM[x]->begin() != 0) //Begin returns 0 on a good init
        {
          Serial.print("Sensor ");
          Serial.print(x);
          Serial.println(" did not begin! Check wiring");
          initSuccess = false;
        }
        else
        {
          //Configure each sensor
          myISM.setDeviceConfig();
          myISM.setBlockDataUpdate();
          
          // Set the output data rate and precision of the accelerometer
          myISM.setAccelDataRate(ISM_XL_ODR_416Hz);
          myISM.setAccelFullScale(ISM_2g);
    
          // Set the output data rate and precision of the gyroscope
          myISM.setGyroDataRate(ISM_GY_ODR_416Hz);
          myISM.setGyroFullScale(ISM_125dps);
    
          // Turn on the accelerometer's filter and apply settings.
          myISM.setAccelFilterLP2();
          myISM.setAccelSlopeFilter(ISM_LP_ODR_DIV_100);
    
          // Turn on the gyroscope's filter and apply settings.
          myISM.setGyroFilterLP1();
          myISM.setGyroLP1Bandwidth(ISM_XTREME);
          
          Serial.print("Sensor ");
          Serial.print(x);
          Serial.println(" configured");
        }
      }
    
      if (initSuccess == false)
      {
        Serial.print("Freezing...");
        while (1)
          ;
      }
    
      Serial.println("Mux Shield online"); 
    }
    
    void loop()
    {
      for (byte x = 0 ; x < NUMBER_OF_SENSORS ; x++)
      {
        enableMuxPort(x); //Tell mux to connect to this port, and this port only
    
        if (accel.available())
        {
          accel.read();
    
          Serial.print("Accel ");
          Serial.print(x);
          Serial.print(": ");
          Serial.print(accel.cx, 2);
          Serial.print(" ");
          Serial.print(accel.cy, 2);
          Serial.print(" ");
          Serial.print(accel.cz, 2);
          Serial.print(" ");
    
          Serial.println(); // Print new line every time.
        }
    
        else myISM.checkStatus();
        {
          myISM.getAccel(&accelData);
          myISM.getGyro(&gyroData);
          Serial.print("Accelerometer: ");
          Serial.print("X: ");
          Serial.print(accelData.xData);
          Serial.print(" ");
          Serial.print("Y: ");
          Serial.print(accelData.yData);
          Serial.print(" ");
          Serial.print("Z: ");
          Serial.print(accelData.zData);
          Serial.println(" ");
          Serial.print("Gyroscope: ");
          Serial.print("X: ");
          Serial.print(gyroData.xData);
          Serial.print(" ");
          Serial.print("Y: ");
          Serial.print(gyroData.yData);
          Serial.print(" ");
          Serial.print("Z: ");
          Serial.print(gyroData.zData);
          Serial.println(" ");
      }
        disableMuxPort(x); //Tell mux to disconnect from this port
      }
    
      delay(1000); //Wait for next reading
    }
    

    I get the following output when I attempt to verify.

    Compilation error: no match for ‘operator=’ (operand types are ‘SparkFun_ISM330DHCX’ and ‘SparkFun_ISM330DHCX**’)

    The full error as follows:

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino: In function ‘void setup()’:

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:46:58: error: no match for ‘operator=’ (operand types are ‘SparkFun_ISM330DHCX’ and ‘SparkFun_ISM330DHCX**’)

    myISM = new SparkFun_ISM330DHCX *[NUMBER_OF_IMU_SENSORS];

    ^

    In file included from C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:4:

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: candidate: ‘SparkFun_ISM330DHCX& SparkFun_ISM330DHCX::operator=(const SparkFun_ISM330DHCX&)’

    class SparkFun_ISM330DHCX : public QwDevISM330DHCX

    ^~~~~~~~~~~~~~~~~~~

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: no known conversion for argument 1 from ‘SparkFun_ISM330DHCX**’ to ‘const SparkFun_ISM330DHCX&’

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: candidate: ‘SparkFun_ISM330DHCX& SparkFun_ISM330DHCX::operator=(SparkFun_ISM330DHCX&&)’

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: no known conversion for argument 1 from ‘SparkFun_ISM330DHCX**’ to ‘SparkFun_ISM330DHCX&&’

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:50:10: error: no match for ‘operator’ (operand types are ‘SparkFun_ISM330DHCX’ and ‘int’)

    myISM = new SparkFun_ISM330DHCX(Wire);

    ^

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:50:44: error: no matching function for call to ‘SparkFun_ISM330DHCX::SparkFun_ISM330DHCX(TwoWire&)’

    myISM = new SparkFun_ISM330DHCX(Wire);

    ^

    In file included from C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:4:

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:12:3: note: candidate: ‘SparkFun_ISM330DHCX::SparkFun_ISM330DHCX()’

    SparkFun_ISM330DHCX() {};

    ^~~~~~~~~~~~~~~~~~~

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:12:3: note: candidate expects 0 arguments, 1 provided

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: candidate: ‘constexpr SparkFun_ISM330DHCX::SparkFun_ISM330DHCX(const SparkFun_ISM330DHCX&)’

    class SparkFun_ISM330DHCX : public QwDevISM330DHCX

    ^~~~~~~~~~~~~~~~~~~

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: no known conversion for argument 1 from ‘TwoWire’ to ‘const SparkFun_ISM330DHCX&’

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: candidate: ‘constexpr SparkFun_ISM330DHCX::SparkFun_ISM330DHCX(SparkFun_ISM330DHCX&&)’

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: no known conversion for argument 1 from ‘TwoWire’ to ‘SparkFun_ISM330DHCX&&’

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:60:8: error: redeclaration of ‘byte currentPortNumber’

    byte currentPortNumber = myMux.getPort();

    ^~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:41:8: note: ‘byte currentPortNumber’ previously declared here

    byte currentPortNumber = myMux.getPort();

    ^~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:92:14: error: no match for ‘operator’ (operand types are ‘SparkFun_ISM330DHCX’ and ‘byte’ {aka ‘unsigned char’})

    if (myISM->begin() != 0) //Begin returns 0 on a good init

    ^

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino: In function ‘void loop()’:

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:141:5: error: ‘enableMuxPort’ was not declared in this scope

    enableMuxPort(x); //Tell mux to connect to this port, and this port only

    ^~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:143:9: error: ‘accel’ was not declared in this scope

    if (accel.available())

    ^~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:143:9: note: suggested alternative: ‘access’

    if (accel.available())

    ^~~~~

    access

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:185:5: error: ‘disableMuxPort’ was not declared in this scope

    disableMuxPort(x); //Tell mux to disconnect from this port

    ^~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:185:5: note: suggested alternative: ‘disableLoopWDT’

    disableMuxPort(x); //Tell mux to disconnect from this port

    ^~~~~~~~~~~~~~

    disableLoopWDT

    exit status 1

    Compilation error: no match for ‘operator=’ (operand types are ‘SparkFun_ISM330DHCX’ and ‘SparkFun_ISM330DHCX**’)

    I also attempt to use run the two IMUs with the I2C Mux Breakout but failed in that attempt as well.

    My next step is to review additional tutorials on writing Arduino sketches, but I’d appreciate any direction on how to correct my mistake(s) in the meantime.

    start with changing your definition from

    SFEVL53L1X **distanceSensor;
    SparkFun_ISM330DHCX myISM;
    

    to

    SFEVL53L1X **distanceSensor;
    SparkFun_ISM330DHCX **myISM;
    

    Thank you for the reply, Paul.

    When I change the definition as you instructed, I get the following compilation error:

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino: In function ‘void setup()’:

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:50:44: error: no matching function for call to ‘SparkFun_ISM330DHCX::SparkFun_ISM330DHCX(TwoWire&)’

    myISM = new SparkFun_ISM330DHCX(Wire);

    ^

    In file included from C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:4:

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:12:3: note: candidate: ‘SparkFun_ISM330DHCX::SparkFun_ISM330DHCX()’

    SparkFun_ISM330DHCX() {};

    ^~~~~~~~~~~~~~~~~~~

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:12:3: note: candidate expects 0 arguments, 1 provided

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: candidate: ‘constexpr SparkFun_ISM330DHCX::SparkFun_ISM330DHCX(const SparkFun_ISM330DHCX&)’

    class SparkFun_ISM330DHCX : public QwDevISM330DHCX

    ^~~~~~~~~~~~~~~~~~~

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: no known conversion for argument 1 from ‘TwoWire’ to ‘const SparkFun_ISM330DHCX&’

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: candidate: ‘constexpr SparkFun_ISM330DHCX::SparkFun_ISM330DHCX(SparkFun_ISM330DHCX&&)’

    c:\Users\IMG\Documents\Arduino\libraries\SparkFun_6DoF_ISM330DHCX\src/SparkFun_ISM330DHCX.h:7:7: note: no known conversion for argument 1 from ‘TwoWire’ to ‘SparkFun_ISM330DHCX&&’

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:60:8: error: redeclaration of ‘byte currentPortNumber’

    byte currentPortNumber = myMux.getPort();

    ^~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:41:8: note: ‘byte currentPortNumber’ previously declared here

    byte currentPortNumber = myMux.getPort();

    ^~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:102:13: error: request for member ‘setDeviceConfig’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setDeviceConfig();

    ^~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:103:13: error: request for member ‘setBlockDataUpdate’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setBlockDataUpdate();

    ^~~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:106:13: error: request for member ‘setAccelDataRate’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setAccelDataRate(ISM_XL_ODR_416Hz);

    ^~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:107:13: error: request for member ‘setAccelFullScale’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setAccelFullScale(ISM_2g);

    ^~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:110:13: error: request for member ‘setGyroDataRate’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setGyroDataRate(ISM_GY_ODR_416Hz);

    ^~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:111:13: error: request for member ‘setGyroFullScale’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setGyroFullScale(ISM_125dps);

    ^~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:114:13: error: request for member ‘setAccelFilterLP2’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setAccelFilterLP2();

    ^~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:115:13: error: request for member ‘setAccelSlopeFilter’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setAccelSlopeFilter(ISM_LP_ODR_DIV_100);

    ^~~~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:118:13: error: request for member ‘setGyroFilterLP1’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setGyroFilterLP1();

    ^~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:119:13: error: request for member ‘setGyroLP1Bandwidth’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.setGyroLP1Bandwidth(ISM_XTREME);

    ^~~~~~~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino: In function ‘void loop()’:

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:141:5: error: ‘enableMuxPort’ was not declared in this scope

    enableMuxPort(x); //Tell mux to connect to this port, and this port only

    ^~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:143:9: error: ‘accel’ was not declared in this scope

    if (accel.available())

    ^~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:143:9: note: suggested alternative: ‘access’

    if (accel.available())

    ^~~~~

    access

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:160:16: error: request for member ‘checkStatus’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    else myISM.checkStatus();

    ^~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:162:13: error: request for member ‘getAccel’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.getAccel(&accelData);

    ^~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:163:13: error: request for member ‘getGyro’ in ‘myISM’, which is of non-class type ‘SparkFun_ISM330DHCX**’

    myISM.getGyro(&gyroData);

    ^~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:185:5: error: ‘disableMuxPort’ was not declared in this scope

    disableMuxPort(x); //Tell mux to disconnect from this port

    ^~~~~~~~~~~~~~

    C:\Users\IMG\Documents\Arduino\Customized Arduino Code\Double_ToF_IMU_v03\Double_ToF_IMU_v03.ino:185:5: note: suggested alternative: ‘disableLoopWDT’

    disableMuxPort(x); //Tell mux to disconnect from this port

    ^~~~~~~~~~~~~~

    disableLoopWDT

    exit status 1

    Compilation error: no matching function for call to ‘SparkFun_ISM330DHCX::SparkFun_ISM330DHCX(TwoWire&)’

    I will also add that I have the distance sensors connected to mux ports 0 & 1 and the IMUs connected to ports 2 & 3.

    You will have to study the driver, especially SparkFun_ISM330DHCX.h . There is no constructor call ‘new SparkFun_ISM330DHCX(Wire);’, there is only ‘new SparkFun_ISM330DHCX();’ you can provide the wire interface and/or address with begin().