I have a project with 1 BME680 (temp, humidity, gas, pressure sensor) and two SHCT3 temp/humidity sensors. As the SHCT3 have neither cs_ nor programmable addressing, I have to use two i2c connections - 1st with 1 SHCT3 and the BME680, and the second bus for the second SHCT3. The host board is an Arduino MKR1000.
Adafruit provide nice libraries for each sensor which assume the standard Wire interface which is fine for i2c bus1. I have found SlowSoftWire which is a Wire like wrapper for SlowSoftI2CMaster - a bit bashed library for I2C which I proposed to used for bus2.
I blithely thought I could use the Adafruit code directly like this:
SlowSoftWire wire2=SlowSoftWire(6,7);// create bit bashed wire interface SDA2 on 6 SK2 on 7
if (! shtc3.begin(wire2)) {
Serial.println("Couldn't find SHTC3");
while (1) delay(1);
But the compiler errors with:
SHTC3test:23:26: error: no matching function for call to 'Adafruit_SHTC3::begin(SlowSoftWire&)'
I interpret that its expecting a Wire object, but getting a SlowSoft Wire object. In the Adafruit library the function def is:
bool begin(TwoWire *theWire = &Wire);
This is total Greek to me
Given that the wrapper is there to make the library look like a Wire library, I assume that there is some way to allow my software i2c to work with the Adafruit library? However, its gone beyond my expertise to work out how. Maybe there is a simpler approach altogether, idk
Many thanks for any insight,
Kevin.