Components:
- Raspberry Pi Zero: https://www.raspberrypi.com/products/raspberry-pi-zero/
- 64x32 LED Matrix: https://www.adafruit.com/product/2278
- Adafruit RGB Matrix Bonnet for Raspberry Pi: https://www.adafruit.com/product/3211
To get the matrix up and running there are two main parts:
- Prepare your content, and
- Getting the sign up and running
There are also some Assets provided in assets/
:
5x5.ttf
: which is a 5 pixel tall font and looks great on the LED matrixgame-over.psd
: which is a game over screen used in the tetris exampletetris-game
: A small node.js server for generatinng tetris images and saving them as pngs, based on this tetris game and this png-to-gif savermake-frames-into-gif.sh
: A short script using ffmpeg to make separate PNGs into a GIF for the sign
The sign accepts animated gifs in the resolution 64x32 (widescreen) where the actual bottom of the display is to the right edge. Example: (4k.gif)
Limitations:
- A maximum of about 4000 frames seems to work, if your animation is longer, simply split it up into separate gifs, like
part1.gif
,part2.gif
and so on...
Tutorial can be found here: https://learn.adafruit.com/adafruit-rgb-matrix-bonnet-for-raspberry-pi/driving-matrices
curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/main/rgb-matrix.sh >rgb-matrix.sh
sudo bash rgb-matrix.sh
Tutorial here: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/utils#image-viewer
cd ~/rpi-rgb-led-matrix/utils
sudo apt-get update
sudo apt-get install libgraphicsmagick++-dev libwebp-dev -y
make led-image-viewer
5. Transfer all your gifs to the pi and save them to the ~/rpi-rgb-led-matrix/utils
folder (same as "led-image-viewer")
All the tetris files I've used are in the final-gifs
folder
Let's say you have the files 1.gif
and 2.gif
. Then you need to create 1.stream
and 2.stream
like this:
touch 1.stream 2.stream
chmod 666 *.stream
-D500
represents a delay of 500ms per frame, see the specs for details
1.gif
and 1.stream
should of course be replaced with the name of your gifs
sudo ./led-image-viewer --led-rows=32 --led-cols=64 --led-gpio-mapping=adafruit-hat -D500 16k.gif -O16k.stream
Now everything is prepped and we can create the file that will run the display when you plug in the cable
Use the command nano run.sh
to open the editor and add:
date '+%m-%d-%y %H:%M:%S - Started' >> ./log.txt
sudo ./led-image-viewer --led-rows=32 --led-cols=64 --led-gpio-mapping=adafruit-hat -f -D500 4k.stream 8k.stream 12k.stream 16k.stream 20k.stream 24k.stream -D-1 game-over.stream
date '+%m-%d-%y %H:%M:%S - Stopped' >> ./log.txt
CMD: crontab -e
Add:
@reboot cd /home/USERNAME/rpi-rgb-led-matrix/utils && bash ./run.sh
LINKS: