Modifications

Sauter à la navigation Sauter à la recherche
2 674 octets ajoutés ,  29 août 2017 à 20:03
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{Rasp-Hack-GPIO-NAV}}
 
{{Rasp-Hack-GPIO-NAV}}
   −
L'interface I2C est un standard très utilisé conçu pour permettre à un circuit intégré<br />
+
{{traduction}}
de communiquer avec une autre.
     −
Puisque Raspberry Pi est capable de dialoguer en I2C, nous pouvons donc connecter une<br />
+
I2C is a very commonly used standard designed to allow one chip to talk to another. So, since the Raspberry Pi can talk I2C we can connect it to a variety of I2C capable chips and modules.  
grande variété de composants et modules supportant le protocole I2C.
     −
Voici quelques projets qui utilisent des modules et composants I2C:
+
Voici quelques projets et produits qui utilisent des modules et composants I2C:
    
* [[Rasp-Hack-MCP230XX|GPIO Expander pour Raspberry Pi]] Ajouter des entrées/sorties digitales à votre Pi.
 
* [[Rasp-Hack-MCP230XX|GPIO Expander pour Raspberry Pi]] Ajouter des entrées/sorties digitales à votre Pi.
Ligne 17 : Ligne 15 :  
* [[Rasp-Hack-BMP085|Mesure de pression avec le BMP085]]
 
* [[Rasp-Hack-BMP085|Mesure de pression avec le BMP085]]
   −
{{bloc-etroit|text=
+
{{ambox | text = Avec le temps, nous traduirons de plus en plus des tutoriels mentionnés ci-dessus... mais peut-être oublierons nous de remplacer les liens. N'hésitez pas a nous envoyer un petit mail (soyez précis svp) depuis le formulaire de contact  de www.mchobby.be ;-) }}
 +
 
 +
The I2C bus allows multiple devices to be connected to your Raspberry Pi, each with a unique address, that can often be set by changing jumper settings on the module. It is very useful to be able to see which devices are connected to your Pi as a way of making sure everything is working.
 +
 
 +
To do this, it is worth running the following commands in the Terminal to install the i2c-tools utility.
 +
 
 +
<syntaxhighlight lang="bash">
 +
sudo apt-get install -y python-smbus
 +
sudo apt-get install -y i2c-tools
 +
</syntaxhighlight>
 +
 
 +
== Installer le support noyau (avec Raspi-Config) ==
 +
 
 +
Run {{fname|sudo raspi-config}} and follow the prompts to install i2c support for the ARM core and linux kernel
 +
 
 +
Go to '''Interfacing Options''' (Options d'interface):
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-10.png|640px]]
 +
 
 +
On older versions, look under '''Advanced''' (Options avancées)
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-11.png|640px]]
 +
 
 +
puis I2C
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-12.png|640px]]
 +
 
 +
Et activez le bus I2C (en répondant Yes / Oui).
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-13.png|640px]]
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-14.png|640px]]
 +
 
 +
Then reboot!
 +
 
 +
{{ambox|text=We also recommend going through the steps below to manually check everything was added by raspi-config!}}
 +
 
 +
== Installer le support noyau (à la main) ==
 +
If you're not using a modern Raspbian or you want to do it by hand, you can! Open LXTerminal or console or ssh and enter the following command:
 +
 
 +
<nowiki>sudo nano /etc/modules</nowiki>
 +
 
 +
and add these two lines to the end of the file:
 +
 
 +
<nowiki>i2c-bcm2708&nbsp;
 +
i2c-dev</nowiki>
 +
 
 +
Ce qui ressemble à ceci :
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-20.png|640px]]
 +
 
 +
Then save the file with '''Control-X Y''' <return>
 +
 
 +
Depending on your distribution, you may also have a file called '''/etc/modprobe.d/raspi-blacklist.conf'''
 +
 
 +
If you do not have this file then there is nothing to do, however, if you do have this file, you need to edit it and comment out the lines below:
 +
 
 +
<nowiki>blacklist spi-bcm2708
 +
blacklist i2c-bcm2708</nowiki>
 +
 
 +
.. by putting a # in front of them.
 +
 
 +
Open an editor on the file by typing:
 +
 
 +
<nowiki>sudo nano /etc/modprobe.d/raspi-blacklist.conf</nowiki>
 +
 
 +
.. then edit the file so that it appears as below, and then save and exit the file using CTRL-x and Y.
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-21.png|640px]]
 +
 
 +
If you are running a recent Raspberry Pi (3.18 kernel or higher) you will also need to update the {{fname|/boot/config.txt}} file. Edit it with {{fname|sudo nano /boot/config.txt}} and add the text
 +
 
 +
<nowiki>dtparam=i2c1=on
 +
dtparam=i2c_arm=on</nowiki>
 +
 
 +
at the bottom. note that the "1" in "i2c1" is a one not an L!
 +
 
 +
[[Fichier:Rasp-Hack-GPIO-Config-I2C-22.png|640px]]
 +
 
 +
Once this is all done, reboot!
 +
 
 +
sudo reboot
   −
{{ambox | text = Avec le temps, nous traduirons de plus en plus des tutoriels mentionnés ci-dessus... mais peut-être oublierons nous de remplacer les liens. N'hésitez pas a nous envoyer un petit mail (soyez précis svp) depuis le formulaire de contact  de www.mchobby.be ;-) }}
     −
}}
+
== PREVIOUS CONTENT ==
    
Si vous utilisez Occidentalis, alors votre Pi est déjà prêt à supporter I2C (pour autant qu'il soit possible au programme d'accéder au broches matérielles).  
 
Si vous utilisez Occidentalis, alors votre Pi est déjà prêt à supporter I2C (pour autant qu'il soit possible au programme d'accéder au broches matérielles).  
29 917

modifications

Menu de navigation