Introduction
CircuitPython driver for Kinetic Technologies 36-Channel KTD2061 and 12-Channel KTD2052 RGB LED driver IC families.
KTD2061 Series Overview
The KTD2061/60/59/58 are fully programmable current regulator for 12 RGBs LED Modules (36 LED channels). Additionally, with its fade engine and BrightExtend™ technology, the color output and transitions are perfectly smooth. With their three 4-wire multiplexed buses, they require only 4 wires for I2C interface (3.3V/SDA/SCL/GND)! All EV Kits are perfectly compatiable with Adafruit’s Stemma Cable.
KTD2052 Series Overview
The KTD2052 is a fully programmable current regulator for 4 RGB LED Modules (12 LED channels). It also includes a programmable pattern generator that can store up to 8 patterns, minimizing I2C traffic. Additionally, with its fade engine and BrightExtend™ technology, the color output and transitions are perfectly smooth. With its 4-wire multiplexed bus, it requires only 4 wires for I2C interface (3.3V/SDA/SCL/GND)! All EV Kits are perfectly compatible with Adafruit’s Stemma Cable.
Tutorial with QTPY RP2040
Required Hardware
Individual Components:
- Supported Kinetic RGB Driver Board
KTD2061/60/59/58
KTD2052A/B/C/D
QTPY RP2040
Stemma Cable
USBA-USBC Cable
PC
Follow the Adafruit Circuit Python Guide
Install the Kinetic RGB library by copying kinetic_rgb.py onto the QTPY RP2040.
Connect your Kinetic Product to the QTPY RP2040 via Adafruit Stemma Cable.
Copy any of the below examples into code.py on your QTPY RP2040.
GUI (Graphical User Interface)
Both the KTD2052 and KTD2061 come with a GUI to control the part via the MCP2221A, should the user prefer that. It controls the part by directly writing to the registers based on the user’s input, allowing for a more bare-metal approach.
Usage Examples (QTPY RP2040)
KTD2061 Series Basic Test
import board
import busio
from kinetic_rgb import *
from kinetic_rgb import KTD2061
# from kinetic_rgb import KTD2060
# from kinetic_rgb import KTD2059
# from kinetic_rgb import KTD2058
# Initialize the I2C bus
i2c = busio.I2C(board.SCL1, board.SDA1, frequency=1000000)
KineticRGB = KTD2061(i2c)
# KineticRGB = KTD2060(i2c)
# KineticRGB = KTD2059(i2c)
# KineticRGB = KTD2058(i2c)
KineticRGB.global_control(
enable_mode=EnableMode.MODE_DAY,
bright_ext=1,
cool_ext=CoolExtendTemp.DEGREES_105C,
fade_rate0=None,
)
print("Initialization complete")
KineticRGB.set_color0(CommonColors.SKY_BLUE)
KineticRGB.set_rgb_module_color_mix(KTD2061RGBModuleSelect.RGB_MODULE_ALL, 0, 0, 0)
KineticRGB.set_rgb_module_to_on(KTD2061RGBModuleSelect.RGB_MODULE_ALL)
KTD2061 Series Simple Test
KTD2052 Series Basic Test
import board
import busio
from kinetic_rgb import *
from kinetic_rgb import KTD2052A
# from kinetic_rgb import KTD2052B
# from kinetic_rgb import KTD2052C
# from kinetic_rgb import KTD2052D
# Initialize the I2C bus
i2c = busio.I2C(board.SCL, board.SDA, frequency=1000000)
KineticRGB = KTD2052A(i2c)
# KineticRGB = KTD2052B(i2c)
# KineticRGB = KTD2052C(i2c)
# KineticRGB = KTD2052D(i2c)
KineticRGB.global_control(
enable_mode=EnableMode.MODE_DAY,
bright_ext=1,
cool_ext=CoolExtendTemp.DEGREES_105C,
fade_rate0=None,
)
KineticRGB.set_rgbx_color(CommonColors.SkyBlue, KTD2052RGBModuleSelect.RGB_MODULE_ALL)
KTD2052 Series Simple Test
Dependencies
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
Installing to a Connected CircuitPython Device with Circup
Make sure that you have circup installed in your Python environment.
Install it with the following command if necessary:
pip3 install circup
With circup installed and your CircuitPython device connected use the
following command to install:
circup install kinetic_rgb
Or the following command to update an existing version:
circup update
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.