ClosedCube_OPT3001_Arduino icon indicating copy to clipboard operation
ClosedCube_OPT3001_Arduino copied to clipboard

Add option to choose between I2C interfaces

Open beegee-tokyo opened this issue 3 years ago • 0 comments

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).

beegee-tokyo avatar Feb 13 '22 03:02 beegee-tokyo