I have an LED display connected to a Teensy microcontroller using the FastLED library, which is connected to a Raspberry Pi Zero running Python via a USB hub.
I am looking for an existing library that handles the serial communication so that I can run commands in Python that trigger equivalent commands in FastLED on the Teensy efficiently and while respecting frame rate.
I've tried googling numerous times and searched the FastLED docs to see if there is something there. While there are many examples of code to drive LED displays via serial communication, I have not found a general library or package to do this.
E.g. What I'm looking for is something like this (simplified):
On the RPi:
dis = Display()
dis.connect()
for i in range(10):
dis.setLED(i, (64, 0, 0))
Would cause the Teensy to execute:
leds[i].r = data[i];
leds[i].g = data[i + 1];
leds[i].b = data[i + 2];
I would expect other convenient functionality such as:
leds = [11, 15, 19]
data = [
(32, 64, 96),
(64, 32, 96)
(96, 32, 64)
]
dis.setLEDs(leds, data)
data = ...
dis.setAllLEDs(data)
dis.clear()
That kind of thing.
Obviously, I can go ahead and write a library to do this myself but I can't believe it doesn't exist already so hoping someone will point me to something.