with python bindings!
The TLC59711 is a 12-channel 16-bit PWM LED driver controlled via SPI. This project adapts Adafruit's TLC59711 Library for Arduino into a C++ library for Raspberry Pi. It uses the BCM2835 C library to send SPI messages to the driver.
If you don't already have the BCM2835 C Library installed download and install it from source:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
tar xvfz bcm2835-1.60.tar.gz
cd bcm2835-1.60
./configure
make
sudo make install
You will also need the pybind11:
pip install pybind11
You can install either the C++ library, python bindings, or both depending on how you plan to use the project.
mkdir build
cd build
cmake ..
make
sudo make install
./setup.py install
The project uses the same API as Adafruit's Arduino Library.
#include <tlc59711.h>
uint8_t n = 1; # Number of chained TLC59711 chips
TLC59711 tlc = TLC59711(n);
tlc.begin();
uint8_t led_num = 1;
tlc.setLED(led_num, 65535, 65535, 65535); # Set led 1 to white
tlc.write();
from tlc59711 import TLC59711
n = 1 # Number of chained TLC59711 chips
tlc = TLC59711(n)
tlc.begin()
led_num = 1
tlc.setLED(led_num, 65535, 65535, 65535) # Set led 1 to white
tlc.write()