Using the Adafruit Library

The Python code to work with Adafruit's LED Backpacks on the Pi is available on Github at
https://github.com/adafruit/Adafruit_Python_LED_Backpack
This code should be a good starting point to understanding how you can access SMBus/I2C devices with your Pi, and getting your blinky on.

If you're running Raspbian, you will need to set up I2C first.

Follow this tutorial to fully enable i2c

Install required software

      sudo apt-get update
sudo apt-get install -y git build-essential python-dev python-smbus python-imaging python-pip python-pil
    

Downloading the Code from Github

The easiest way to get the code onto your Pi is to hook up an Ethernet cable, and clone it directly using 'git'.  Simply run the following commands from an appropriate location (ex. "/home/pi"):

git clone https://github.com/adafruit/Adafruit_Python_LED_Backpack.git
cd Adafruit_Python_LED_Backpack
sudo python setup.py install

Testing the Library

Once the code has be downloaded to an appropriate folder, and you have your LED Backpack board properly connected, you can test it out with the following commands (the driver includes a few simple demo programs)

For 8x8 displays, you can run a simple test with:
cd examples
sudo python matrix8x8_test.py
Which should result in something like the following:
For 4-character, 7-segment displays, you can run a clock demo with:
sudo python sevensegment_test.py
Which should result in the following:
Last updated on 2016-10-27 at 04.26.50 PM Published on 2012-08-24 at 04.17.01 PM