Giga R1 using all three I2C Busses

Hi, I am new at using the giga. I would like to use all three I2C busses on this board to communicate to three groups of I2C sensors. So far I can only communicate to the default "wire" group. Can the giga r1 actually use all three busses in one program and how do I direct communications to the other two busses (wire1 and wire2)? Thanks very much

Hi, I'm using two of the three happily.

Use Wire1 and Wire2 as you would Wire to address the others (e.g. Wire2.begin()), or I2C_SDA / I2C_SCL, I2C_SDA1 / I2C_SCL1 and I2C_SDA2 / I2C_SCL2 pins if you plan to use mbed::I2C directly.

Thank you for the reply. Some sensors will have the same slave address, but on a different bus. Do I need to address the first group after the "Wire.begin", then the second group after the "Wire1.begin" and so forth? Sorry for the newbe questions.....

No problem, we've all been there.

Yes, each interface will need a begin() before using it. Typically you will begin() each interface in your setup and then write/request inside your loop.

Are you planning on using libraries to access your sensors? It's worth checking to see if they support the Wire interface as an argument - many are hardcoded for Wire so will need tweaking for Wire1, Wire2

Ahh, maybe the library is the issue. When I run test cases with "Wire1.begin" or "Wire2.begin" it continues to default to addressing the slave devices on bus 1.

I am using these libraries:
#include <Wire.h>
#include <Adafruit_TMP117.h>
#include <Adafruit_Sensor.h>

Is there a better library to use that supports the three busses?

Thanks very much!

To use Wire1 you need to change everywhere that uses Wire to use Wire1...

Many libraries allow you to pass in a pointer or reference to which of these objects and they keep a pointer to the right one and reference all of the methods using that pointer...

For example if you look at the Adafruit_TMP117 at the begin method:

bool begin(uint8_t i2c_addr = TMP117_I2CADDR_DEFAULT, TwoWire *wire = &Wire,
             int32_t sensor_id = 117);

You can pass it in on the begin method.
And it takes care of it...
like: sensor1.begin(TMP117_I2CADDR_DEFAULT, &Wire1);

The Adafruit suite is ideal if you're just starting out. Typically the constructor or begin() accepts a pointer to the I2C interface, defaulting to Wire.
e.g. bool begin(uint8_t addr = BME280_ADDRESS, TwoWire *theWire = &Wire);

for their 280 pressure sensor

p.s. only Wire.h needs to be added, Wire1 and Wire2 will be included

wow....... awesome, thank you...it is working.!!!

Adafruit_TMP117 sensor1;
Adafruit_TMP117 sensor2;
Adafruit_TMP117 sensor3;
Adafruit_TMP117 sensor4;
Adafruit_TMP117 sensor5;

// Array to store temperature values for each sensor
float temperatureValues[5];

void setup() {
Serial.begin(9600);
Wire.begin();
sensor1.begin(0x48,&Wire);
sensor2.begin(0x49,&Wire);
sensor3.begin(0x4A,&Wire);
sensor4.begin(0x4B,&Wire);
Wire1.begin();
sensor5.begin(0x48,&Wire1);