mattjlewis / diozero

Java Device I/O library that is portable across Single Board Computers and microcontrollers. Tested with Raspberry Pi, Odroid C2, BeagleBone Black, Next Thing CHIP, Asus Tinker Board and Arduinos / Pico. Supports GPIO, I2C, SPI as well as Serial communication. Also known to work with Udoo Quad.
https://www.diozero.com
MIT License
261 stars 59 forks source link

PCA9685 should have a constructor that takes an I2CDeviceInterface #199

Closed EAGrahamJr closed 4 months ago

EAGrahamJr commented 4 months ago

STEMMA/QT devices are becoming more common, making it easier to "wire" them together, avoiding soldering. Along with that are now multiplexers that allow users to connect breakouts with the same I2C address without requiring soldering. As an example, using a multiplexer would allow one to technically control 8x16 PWM devices.

However, the PCA9685 does not accept an I2CDeviceInterface as a constructor parameter. Adding that constructor would set up the above situation with ease.