Nice, thank you guys for the considerations.
For now the solution that I've found is to establish a connection once per sensor and end communication.
I'm not sure if is a good practice with I2C communication, but is working for a simple using.
Of course it has a little more delay in the measurements.
if (!sht3x.begin(&Wire1, SHT3X_I2C_ADDR, 0, 26, 400000U)) {
Serial.println("Couldn't find SHT3X");
while (1) delay(1);
}
if (sht3x.update()) {
Serial.print("SHT30 - Temperatura: ");
Serial.print(sht3x.cTemp);
Serial.print(" - Umidade: ");
Serial.println(sht3x.humidity);
//DISPLAY
StickCP2.Display.fillRect(110, 30, 100, 30, BLACK);
StickCP2.Display.setCursor(5, 30);
StickCP2.Display.setTextColor(BLUE);
StickCP2.Display.printf("SHT30: %.1f", sht3x.cTemp);
}
Wire.end();
delay(1000);
if (!sht4x.begin(&Wire, SHT40_I2C_ADDR_44, 32, 33, 400000U)) {
Serial.println("Couldn't find SHT4X");
while (1) delay(1);
}
sht4x.setPrecision(SHT4X_HIGH_PRECISION);
sht4x.setHeater(SHT4X_NO_HEATER);
if (sht4x.update()) {
Serial.print("SHT40 - Temperatura: ");
Serial.print(sht4x.cTemp);
Serial.print(" - Umidade: ");
Serial.println(sht4x.humidity);
//DISPLAY
StickCP2.Display.fillRect(110, 60, 100, 30, BLACK);
StickCP2.Display.setCursor(5, 60);
StickCP2.Display.setTextColor(YELLOW);
StickCP2.Display.printf("SHT40: %.1f", sht4x.cTemp);
}
Wire.end();
delay(1000);