This project contains a generic controller firmware for an AdaFruit 32x32 LED matrix.
The panel itself is connected to a K64F board that runs a generic display controller. The idea was to allow the user to ontrol the 32x32 AdaFruit LED panel from the following interfaces:
- TCP Socket
- UDP Socket
- I2C Interface
- Serial Port
- SPI Interface
These interfaces allow 2 modes of control.
- RAW RGB data frame mode where one can just send a full RGB buffer to the interface, which is then transfered to the panel buffer and displayed.
- A canvas mode where it is possible to draw on a canvas and then transfer that to the panel.
The canvas mode supports a number of actions:
- clear: clearing the canvas
- pixel: setting the color of a single pixel at coordinates x,y
- h-line: horizontal line in a specific color
- v-line: vertical line in a specific color
A possible future enhancement could be a static
action that allows you to draw a static pixel map and save that. After which each clear would clear the canvas except for the static image.
TODO
Currently the controller only supports command mode via the serial interface. An example can be found in the js-controller
application which allows the user to draw pixelart on the led panel.
Command parser is copy of Sille's command parser for DUST. Maybe later it could become a library :). Thx mate. Works as a charm.
The javascript controller code is a small demonstration application on how to interface with the generic controller over a serial interface by sending commands to the display controller. It allows the user to draw PixelArt on the display.
A Raspberry Pi 400 is recommended for a PixelArt setup. Just flash a default Raspbian 64 bit desktop OS and connect the K64 via USB to the Raspberry Pi.
Install NodeJs v19:
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
Clone the repo:
git clone https://github.com/BioBoost/mbed-generic-rgb-panel-controller-pixelart
Install the dependencies
cd mbed-generic-rgb-panel-controller-pixelart
npm install
Start the javascript controller
npm start
Use the following keys:
- arrow-keys: move the cursor
- space: draw pixel
- c: change color
- esc: clear the screen (blank)
- del/backspace: clear pixel
- r: reset (shows rocket)
- d: drag mode (keep drawing while moving)
- s: save
There is also a basic website that displays these key mappings, which can come in handy when showcasing this project.