Connecting multiple SparkFun Tristimulus Color Sensor - OPT4048DTSR (Qwiic) Sensors

I’m having trouble getting the software to read multiple Color Sensors on one Qwiic connection.
I have tried an Arduino Nano, and Sparkfun Pro micro both report back ok when scanning the I2C line for each chip (i have 3 connected and set for individual address) and that reports back ok.

Now my software is configured to match each chips address but when hovering over the code to begin connection to each chip
`myColor.begin(0x44);
myColor2.begin(0x45;
myColor3.begin(0x46);’

it comes up with a popup window saying this

public: bool begin(uint8_t deviceAddress = OPT4048_ADDR_LOW)
That code is in the include library for the sensor.
my programming isn’t strong enough to go changing that in the hopes it would work, hence asking here.

p.s. new to forum formatting sorry if it’s wrong.

:roll_eyes: So ummm after going over the code again found the issue, someone (me) forgot to setup the other 2 sensors in software. I did follow the hardware guide and cut traces where required, but in software forgot to setup the other 2 chips.

  myColor.begin(0x44);
  myColor2.begin(0x45);
  myColor3.begin(0x46);
  myColor.setRange(RANGE_18LUX);  //- Pipette / Vial
  myColor.setConversionTime(CONVERSION_TIME_800MS);
  myColor.setOperationMode(OPERATION_MODE_CONTINUOUS);

only setup myColor and didn’t setup myColor2 & myColor3.

Can report all 3 sensors working :slight_smile:

the setup for curious is

Arduino Nano → Qwiic hub → OPT4048 x 3

1 Like

Excellent, glad to hear you got it working!

1 Like