Skip to content

Raspberry PI running a 16×32 RGB LED


To get started turn off your Pi.

$ sudo shutdown

Disconnect power from the Raspberry Pi.


Compile the Program

Clone the repo:

ssh pi@raspberrypi
# password is: raspberry by default
git clone

Look in that cloned directory:

pi@raspberrypi:~ $ ls rpi-rgb-led-matrix/
adapter  bindings  COPYING  examples-api-use  fonts  img  include  led-matrix  lib  Makefile  utils

Change to that cloned directory:

cd rpi-rgb-led-matrix

Now edit/view the makefile for the correct pinouts:

vi lib/Makefile


For a Raspberry Pi 1 set it to classic-pi1 e.g.:

# There are several different pinouts for various breakout boards that uses
# this library. If you are using the described pinout in the toplevel
# or the standard active-3 breakout board, then 'regular' is the one you'd like
# to use.
# Adafruit also made a breakout board, if you want to use that, choose
# 'adafruit-hat'
# These are the choices
# regular # Following this project wiring and using these PCBs
# adafruit-hat # If you have a RGB matrix HAT from Adafruit
# adafruit-hat-pwm # If you have an Adafruit HAT with PWM hardware mod.
# regular-pi1 # If you have an old Pi1 and regular didn't work.
# classic # (deprecated) Classic Pi1/2/. Not used anymore.
# classic-pi1 # (deprecated) Classic pinout on Rasperry Pi 1

Another option is to compile with:

make -DHARDWARE_DESC=classic-pi1

You can even just change it at run-time:

sudo ./demo -D 1 --led-gpio-mapping=classic-pi1 --led-rows=16 --led-cols=32

Now run:


This will create programs in:

  • /home/pi/rpi-rgb-led-matrix/examples-api-use

Let’s change to that directory and run some:

cd ~/rpi-rgb-led-matrix/examples-api-use


sudo ./demo \
  -D 1 \
  --led-gpui-mapping=classic-pi1 \
  --led-rows=16 \

sudo ./text-example \
  --led-gpio-mapping=classic-pi1 \
  --led-rows=16 \
  --led-cols=32 \
  --led-show-refresh \
  -C 255,255,255 \
  -f ../fonts/7x13.bdf \

sudo ./demo \
  -D 0 \
  --led-gpio-mapping=classic-pi1 \
  --led-rows=16 \
  --led-cols=32 \

# -D 1 needs an image...

sudo ./demo \
  -D 2 \
  --led-gpio-mapping=classic-pi1 \
  --led-rows=16 \
  --led-cols=32 \

sudo ./demo \
  -D 3 \


sudo ./scrolling-text-example \
  --led-gpio-mapping=classic-pi1 \
  --led-rows=16 \
  --led-cols=32 \
  --led-show-refresh \
  -s 10 \
  -C 0,0,255 \
  -f ../fonts/8x13.bdf \

Other References

Connect via:




TheSoftwareProgrammer View All

I like science and writing software.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: