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
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
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|
|SCLK / GPIO 11||23||CLK|
|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
#!/usr/bin/env python import max7219.led as led device = led.matrix(cascaded=1) device.show_message("PIBITS")
Save and run the example by typing the following in at the command line
sudo python max7219/examples/test.py