20131002_131732.jpg

Adafruit's 7-segement LED "Backpack" displayAdafruit's 7-segement LED "Backpack" display turned out to be quite easy to interface with the BeagleBone Black (aka BBB)BeagleBone Black (aka BBB).  "Backpack" means the 7-segment display has a chip on the back side which allows it to be controlled via I2C.  The display just needs power (3.3V) and ground along with the 2 pins on the BBB for I2C data and clock signals.  Here's how I have it wired up on top of an Adadfruit BeagleBone Black prototyping plateAdadfruit BeagleBone Black prototyping plate:

20131018_230748.jpg

20131018_230810.jpg

To get the software installed, I started with these Raspberry Pi instructions:

Matrix and 7-Segment LED Backpack with the Raspberry Pi:Configuring your Pi for I2C
http://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pi/configuring-your-pi-for-i2c


and then I looked at instructions to install Adafruit's Python library for the BeagleBone Black:

 

I2C | Setting up IO Python Library on BeagleBone Black | Adafruit Learning System

http://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/i2c

The Adafruit_I2C.py module is now included in the Adafruit_BBIO library as a top-level module. This means that many of the popular Python libraries built for the Raspberry Pi, will now just work on the BeagleBone Black if they are using I2C

 

Here's actual commands I ran on my BeagleBone Black running Angstrom Linux.  First, make sure the current date & time is set:

 

root@beaglebone:~# /usr/bin/ntpdate -b -s -u pool.ntp.org



 

Install the packages and modules needed:

 

root@beaglebone:~# opkg update && opkg install python-pip python-setuptools python-smbus
root@beaglebone:~# pip install Adafruit_BBIO



 

Then test if the Adafruit BeagleBone Python library is installed ok:

 

root@beaglebone:~# python -c "import Adafruit_BBIO.GPIO as GPIO; print GPIO"
<module 'Adafruit_BBIO.GPIO' from '/usr/lib/python2.7/site-packages/Adafruit_BBIO/GPIO.so'>
root@beaglebone:~# python
Python 2.7.3 (default, May 20 2013, 12:03:28) 
[GCC 4.7.3 20130205 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO; print GPIO
<module 'Adafruit_BBIO.GPIO' from '/usr/lib/python2.7/site-packages/Adafruit_BBIO/GPIO.so'>



 

Next download the Adafruit Python Raspberry Pi library via git.  This library includes Python modules for their products like the 7-segment backpack

 

root@beaglebone:~# git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git



 

Before running the demo Python program, make sure the Linux can "see" your 7-segment module on the I2C bus.  It is configured to have an address of 0x70 so you should see that address in the "map" of the I2C bus that i2cdetect prints out:

 

root@beaglebone:~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_LEDBackpack# i2cdetect -y -r 1
  0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --  



 

Finally, run the demo Python program for the 7-segment display:

 

root@beaglebone:~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_LEDBackpack# python ex_8x8_pixels.py



 

Here is a video I recorded of it running on my BeagleBone Black:

 

Adafruit 7 segment connected to BeagleBone Black - YouTube



Cheers,

Drew Fustini

http://twitter.com/pdp7