Fattoresaimon / ArduinoDuPPaLib

Libraries for DuPPa products on the Arduino IDE
GNU General Public License v3.0
41 stars 24 forks source link

RGB encoders and Teensey 4.1 i2c ports #34

Closed LukeSpad closed 5 months ago

LukeSpad commented 5 months ago

Hi there - I’m building a project with a teensey 4.1 which requires the use of the last 16 contiguous pins of the teensey’s GPIO6 for fast control of an external chip. This includes pins 19 and 18 which are the SCL and SDA for the first i2c bus of the device, as well as pins 18 and 17 which are SCL1 and SDA1 of the second i2c bus. As such I want to use pins 24 and 25 which are SCL2 and SDA2 - this requires wire2.begin() to initialise: Does the library support the use of the teensey’s i2c bus number 3?

LukeSpad commented 5 months ago

I’m aware I could edit the library and find and replace all instances of wire with wire2 but wondering if there is a more elegant solution!

LukeSpad commented 5 months ago

Okay so this is a simple fix - just edit the i2cEncoderLibV2.cpp file and change the function after: /* Private functions ***/ /***** Read function to the encoder ****/

changing Wire for Wire1 or Wire2 as required. Thanks to Simone for the help via private email 👍