Modifications

Sauter à la navigation Sauter à la recherche
980 octets ajoutés ,  11 février 2013 à 19:45
aucun résumé de modification
Ligne 7 : Ligne 7 :  
If you are running Occidentalis and are familiar with Terminal commands, then the description below will be sufficient.
 
If you are running Occidentalis and are familiar with Terminal commands, then the description below will be sufficient.
   −
If not, then to learn more about how to setup I2C with either Raspbian or Occidentalis, then take a minor diversion to this Adafruit Tutorial: http://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c
+
If not, then to learn more about how to setup I2C with either Raspbian or Occidentalis, then take a minor diversion to this Adafruit Tutorial: [[Rasp-Hack-GPIO Configurer I2C|Configurer I2C sur Raspberry Pi]]
 +
 
 +
<nowiki>sudo apt-get install python-smbus
 +
sudo apt-get install i2c-tools</nowiki>
 +
 
 +
i2c-tools isn't strictly required, but it's a useful package since you can use it to scan for any I2C or SMBus devices connected to your board.  If you know something is connected, but you don't know it's 7-bit I2C address, this library has a great little tool to help you find it:  
 +
 
 +
<nowiki>sudo i2cdetect -y 1</nowiki>
 +
 
 +
This will search /dev/i2c-0 for all address, and if a Holtek HT16K33 breakout is properly connected and it's set to it's default address it should show up as follows (the exact address will vary depending on whether or not you have any of the address solder jumpers set).
 +
 
 +
If you happen to have one of the original first batch of Raspberry Pis, you will need to change the 1 to a 0 in the command above.  
 +
 
 +
[[Fichier:Rasp-Hack-Led-Backpack-I2C-01.png]]
 +
 
 +
Once both of these packages have been installed, you have everything you need to get started accessing I2C and SMBus devices in Python.
 +
 
    
{{Rasp-Hack-Led-Backpack-TRAILER}}
 
{{Rasp-Hack-Led-Backpack-TRAILER}}
29 879

modifications

Menu de navigation