I2C Interaction / BBB

Physical connections

GPIO 1: GND —–> 2
GPIO3 :3.3V ——> 4
GPIO19: P9_20 : SCL ——> 18
GPIO20: P9_19: SDA ——> 17

Check Configuration

//To check slave address and bus number
$i2cdetect -r 2
$i2cset 2 0x70 0x70 2
$i2cdump 2 0x70

//To initialise i2c device
$i2cset -y 2 0x70 0x21 // Setup
$i2cset -y 2 0x70 0x81
$i2cset -y 2 0x70 0xe0

Additional Software installation

$sudo apt-get install pip python-dev python-smbus python-imaging git
$sudo pip install Adafruit-LED-Backpack

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

Compile code

Regardless of program language there are device’ slave address and bus number are pre-defined. It is required to change those values to be synchronized with local environment.

##sevensegment_test.py
//display = SevenSegment.SevenSement() 
display =SevenSegment.SevenSegment(address=0x70, busnum=2)

##example.c
//int i2c_bus = 1
int i2c_bus = 2

Reference

https://andicelabs.com/2013/07/adafruit7segment/
https://cdn-learn.adafruit.com/downloads/pdf/led-backpack-displays-on-raspberry-pi-and-beaglebone-black.pdf
https://emalliab.wordpress.com/2013/07/20/adafruit-8x8-backpack-ht16k33-rpi/

Leave a Reply

Your email address will not be published. Required fields are marked *