A few code examples to quickly experiment with LED matrices prepared for a workshop at the UAL Creative Computing Institute.
The aim of the workshop was to develop ideas around a physical low resolution display.
A small framework to facilitate prototyping was developed, presented and used during the workshop.
- RGB LED matrix 32x64 P5 (P5 means that the LED pitch is 5mm)
- HUB75 ribbon cable (usually comes with the matrix)
- 5V power supply (3A minimum), plus cables
- Teensy 3.5 or 3.6 development board (a Teensy 3.2 will do but has limited memory)
- SmartLed shield (not strictly necessary but handy to quickly connect the microcontroller)
All the examples rely on the SmartMatrix library for Arduino.
The many features of the library are not demonstrated: the libraray comes with an extensive collection of examples.
Smallest example program that runs directly on the microcontroller. A few LEDs are activated “manually”.
Another simple example with some moving LEDs.
A slave program that forwards incoming pixel data from the serial port to the LED panels.
The code is unoptimized but runs smooth at 60fps on a single matrix and around 30fps on 4 chained matrices.
The following Processing examples encode some pixels from the canvas (or a render target).
A simple example that grabs all the pixels from the Processing canvas and sends them to the serial port.
Same as above but with a live webcam.
A slightly more structured example with a better (bigger) preview.
The slave is always configured as a stack of matrices. The master program can be configured to slice the canvas according to the desired configuration.
A demonstration running several scenes from a single Processing sketch.
- Additional informations in the code comments.
- Slave and master programs must be configured manually (an automatic configuration is out of scope but could be implemented).