I have four pieces of "Adafruit Sensirion SHT31-D" sensors connected to ATSAMD21G18A custom board.
They are connected to two I2C interfaces and with I2C scanner I can see they are connected ok.
The issue is how to get information from all of them using Adafruit_SHT31.h library?
How can I switch back and forth between those two I2C interfaces in Arduino code?
The second I2C interface is configured with "TwoWire myWire(&sercom5, 16, 17);" in sketch declaration part.
With that declaration I can read the sensors in second I2C interface, but then how do I read the sensors in default I2C interface?
And vice versa: without "TwoWire myWire(&sercom5, 16, 17);" I can read only sensors in default I2C interface.
Any help would be great!
TwoWire myWire(&sercom5, 16, 17);
Adafruit_SHT31 sht31_kotelo = Adafruit_SHT31(); // on default I2C
Adafruit_SHT31 sht31_1 = Adafruit_SHT31(); // on default I2C
Adafruit_SHT31 sht31_2 = Adafruit_SHT31(); // on second I2C on SERCOM5
Adafruit_SHT31 sht31_3 = Adafruit_SHT31(); // on second I2C on SERCOM5
Thanks,if (! sht31_1.begin(0x45)) {
Serial.println("Couldn't find sht31_1.");
} else {
Serial.println("sht31_1 OK.");
Tipo