Home Programming Raspberry Pi 2 and an 8×8 LED matrix

Raspberry Pi 2 and an 8×8 LED matrix

by shedboy71

As part of my arduino/general microcontroller development I purchase a variety of interesting boards and modules, oneof these is a 8×8 LED array which is controlled by a MAX7219. these modules are low cost and are nice for beginners level projects, you can display text, numbers and characters amongst other things.

Here is a typical module

max7219 8x8 matrix

max7219 8×8 matrix

To make life easy there is a python module already available with a couple of examples. Open up a console window and type in the following

[codesyntax lang=”bash”]

git clone https://github.com/rm-hull/max7219.git
sudo python max7219/setup.py install


You connect the module to you Raspberry Pi as follows, the Gnd (39) is for a Raspberry Pi 2. You can use another Gnd connection for another model.

Pi GPIO header Pin Number 8×8 module
MOSI / GPIO 10  19 DIN
5v 2 Vcc
CS0 / GPIO 8 24 CS

Create a file called test.py, I created this in the Examples folder of the max7219. Enter the following code using your favourite text editor


[codesyntax lang=”python”]

#!/usr/bin/env python

import max7219.led as led
device = led.matrix(cascaded=1)



Save and run the example by typing the following in at the command line

[codesyntax lang=”bash”]

sudo python max7219/examples/test.py





MAX7219 Dot Led Matrix Module MCU LED Display Control New Module Kit For Arduino

5pcs/lot MAX7219 Module Dot Matrix Modules for Arduino Control FZ0148 Free Shipping Dropshipping

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More