2014-09-09

At the last Cambridge Jam I picked up a 32×32 LED matrix panel from SK Pang. This consists of 1024 RGB leds and is used as a building block for those large displays you see in stadiums. I could only afford one so my screen is slightly smaller.

It consists of the panel, a ribbon cable, a GPIO adapter and a power cable. I used a RAVPower 10400mAh USB power bank to power it. You need a power source that can provide 5V with at least 2A.

Driving the screen requires a lot of data to be sent to the screen on a constant basis. This makes it unsuitable for Python but better suited to C. I tend to use Python so this makes it slightly outside my comfort zone. Lucky for me Henner Zeller has created a library of C code to drive this board via the Raspberry Pi’s GPIO pins and made it available on his rpi-rgb-led-matrix Github page.

Install C Library

You can download the code to your Pi using :

and then unzip the archive using :

Once extracted you can change to the subdirectory :

and then compile the code using :

Usage

Once compiled you can run the resulting executable using :

which will display the available command line options :

To get something on the panel you can try the including example image “runtext.ppm” :

If your panel is connected correctly and has enough power the “runtext.ppm” image will be scrolled across the screen for 20 seconds.

Custom Graphics

Creating your own graphics to scroll is really easy as long as you have an image editing application that can create Portable Pixmap Format (PPM). I use the GIMP (it’s free!) and this file tpye is available via the “Export as” feature.

You start by loading or creating your source image and then re-sizing it so that it is only 32 pixels high. The width doesn’t matter as it is going to be scrolling horizontally. In GIMP you can simply use “Export as”, use a filename with a .ppm extension and select “Raw” when prompted. This file can then be copied to your Pi. My first custom graphic was a logo and some text :



The command below scrolled this nicely across the panel :

My next test was a small set of flags that looked something like this :



Here is custom_ppm_images zip file with my custom PPM images if you want to try them.

The panel is great fun and the videos don’t really do it justice. As long as you can generate the PPM files you can scroll whatever you like.

I am going to start looking at the C code and see if I can modify it play back a sequence of images from a directory. That way I can create animations. It would also be good to use Python to generate a file and then trigger the C programme to display it.

Show more