Raspberry PI running a 16×32 RGB LED
Wiring
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 https://github.com/hzeller/rpi-rgb-led-matrix/
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 README.md utils wiring.md
Change to that cloned directory:
cd rpi-rgb-led-matrix
Now edit/view the makefile for the correct pinouts:
vi lib/Makefile
Search for: HARDWARE_DESC (type /HARDWARE_DESC)
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 README.md # 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 HARDWARE_DESC?=classic-pi1
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:
make
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
Then…
sudo ./demo \ -D 1 \ --led-gpui-mapping=classic-pi1 \ --led-rows=16 \ --led-cols=32 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 \ Hello sudo ./demo \ -D 0 \ --led-gpio-mapping=classic-pi1 \ --led-rows=16 \ --led-cols=32 \ --led-show-refresh # -D 1 needs an image... sudo ./demo \ -D 2 \ --led-gpio-mapping=classic-pi1 \ --led-rows=16 \ --led-cols=32 \ --led-show-refresh sudo ./demo \ -D 3 \ ...etc... 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 \ Bye
Other References
Connect via:
Categories