While looking for a cheap and nice component to demonstrate the use of SPI (Serial Peripheral Interface) I found out this 8×8 matrix LED display on a board with a MAX7219 chip is the perfect piece of hardware!
What you see in the video is the end result with:
- All on/off
- Demo of all the lines
- Demo of all the columns
- 5 random generated matrixes
- A set of images including an attempt of the Raspberry Pi logo
- A, B, E, S, T fixed
- The same characters scrolling one-by-one
Wiring
As we are using SPI, the number of connections to be made is very minimal:

Code
The sources can be found as an example project within all the sources from the book on GitHub.
The characters and images are created by converting the bit series to byte values inside enums. The number of available definitions is limited as this example is only a demonstration of what you can do, not a fully finished project. So some fun work left for you!
By using the “Find” function in the IDE for value “1” it becomes pretty clear how the defined columns and rows will end up on the matrix display.



Conclusion
You can find these components for a few dollars on eBay and they are great fun to experiment!
















5 Responses
Where can I get an idiots guide to Pi4J V2.0 setup. It seems very complicated compared to V1.0
In case you want a full Maven project, check here: https://pi4j.com/getting-started/minimal-example-application/
Or in a single file with JBang: https://pi4j.com/examples/jbang/jbang_minimal_example/
Neither – how about a simpletons guide in the same style as V1.4, ie, no Maven, which seems to complicate matters and require much downloading. If I can program as per V1, then the program is very straight-forward and self-contained. At a minimum, is there an example written in this manner to drive an HC-SR04 range finder?
Hi, such examples are available in this section of the documentation: https://pi4j.com/examples/jbang/
Not yet with a 8×8 LED Matrix, but that’s actually a good idea! Putting it on my todo list…
@nigel, you challenged me ;-)
A single-file example with Pi4J V2 is available with sources and a video explanation here:
https://pi4j.com/examples/jbang/jbang_pi4j_spi_led_matrix/