I'm using the SoftI2C library by Rhys Weatherley. SoftI2C class that implements the master side of the I2C protocol in software on any arbitrary pair of pins for DATA and CLOCK. The reason to use SoftI2C in this project is to overcome a PCB design error.
I want to know if I have to create a brand new instantiation of the SoftI2C class to be able to talk to a new device introduced on the I2C bus ... OR ... can I reuse the existing instantiation of the class that currently talks to the existing device.
To be clear, an LCD display is currently the only device on the I2C and the LCD library has been modified to use SoftI2C so that the Arduino Nano can display text on it. The LCD library creates an instance of the class from within the its code (.cpp) like this (only essential code parts are shown):
#include <../SoftI2C/SoftI2C.h>
#define I2C_SDA_PIN 17
#define I2C_SCL_PIN 16
SoftI2C softWire(I2C_SDA_PIN, I2C_SCL_PIN);
_i2cAddr = 0x0;
_initialised = softWire.startRead(_i2cAddr, (uint8_t)1);
I'm now introducing a DS1307 RTC on the bus. Its address is 0x68, different than the LCD. I'd like to reuse the softWire instantiate class but I'm not sure whether it is publicly available for use or whether it is private.
Can I please have some guidance?
PS. I hope my explanation makes sense. I've lots of C programming experience but little to no C++ experience. I'm winging this mostly.