ClosedCube_OPT3001_Arduino
ClosedCube_OPT3001_Arduino copied to clipboard
Add option to choose between I2C interfaces
Newer Arduino compatible MCU's have often more than one I2C bus.
This small change adds the option to choose between different Wire instances. It does not break existing code, as the default Wire instance is Wire
Change is in the begin by adding a pointer to the choosen I2C bus instance
OPT3001_ErrorCode begin(uint8_t address, TwoWire &i2c_library = Wire);
This set's the default to Wire, but can change easily by the users to Wire1 (or even Wire2).