Modifications

Sauter à la navigation Sauter à la recherche
2 701 octets ajoutés ,  25 novembre 2017 à 23:12
Ligne 1 : Ligne 1 :  
{{Rasp-Hack-GPIO-NAV}}
 
{{Rasp-Hack-GPIO-NAV}}
   −
To make life easy for those wishing to experiment with attaching electronics to their Pi, Adafruit have produced an extensive and extremely useful collection of code. This includes simple Python libraries for a large number of modules, including displays, sensors and PWM controllers etc.
+
== Introduction ==
 +
AdaFruit Industries à développé une collection très étendue de codes/utilitaires extrêmement utiles en vue de faciliter la vie de hacker désirant faire des expérimentations en raccordant des composants électronique sur leur Raspberry Pi.
   −
To fetch this code, you need to use some software called 'git'. This comes pre-installed on Occidentalis, but on Raspbian you must install it by entering the following commands into LX Terminal.
+
Cette collection inclus des bibliothèques Python simple facile à utiliser et convenant à un grand nombre de modules, incluant des afficheurs, des senseurs, des contrôleurs PWM et etc.
   −
You will find the icon for LX Terminal on your desktop.
+
== Installer Git ==
 +
Pour télécharger de nombreux code, vous aurez besoin d'utiliser un logiciel appelé 'git'. Git est normalement pré-installé sur toutes les distributions récentes. Cependant, si ce dernier n'était pas présent, vous pourriez l'installer en entrant les commandes suivantes dans "LX Terminal".
   −
[[Fichier:Rasp-Hack-GPIO-AdfPiCode1.png]]
+
Vous trouverez l'icône de LX Terminal sur le bureau.
   −
Before we go any further, issue the following command in LXTerminal. This will ensure you package can be found and that you get the latest version. It does not matter which directory you are in.
+
[[Fichier:Rasp-Hack-GPIO-AdfPiCode1.png|125px]]
Copy Code
     −
<nowiki>sudo apt-get update</nowiki>
+
Avant tout autre chose, entrez la commande suivante dans LX Terminal. Cela assure que les paquets puissent être localisés et que vous en obtiendrez la dernière version. Le répertoire dans lequel vous vous trouvez au moment où vous exécutez la commande n'a aucune importance.
 +
 
 +
<syntaxhighlight lang="bash">
 +
sudo apt-get update
 +
</syntaxhighlight>
    
[[Fichier:Rasp-Hack-GPIO-AdfPiCode2.png]]
 
[[Fichier:Rasp-Hack-GPIO-AdfPiCode2.png]]
   −
The update may take a while, especially if this is the first time you have run it on your Pi. Eventually it should give you another command prompt '$' and it will be ready for you to type the next command which is:  
+
La mise à jour peut prendre un moment, plus particulièrement la première fois que vous faite fonctionner votre Pi. Finalement il doit vous proposer une nouvelle invite de commande '$' et il sera alors temps de taper la commande suivante qui est:
 +
 
 +
<syntaxhighlight lang="bash">
 +
sudo apt-get install git
 +
</syntaxhighlight>
 +
 
 +
Une fois que ''git'' est installé (si ce n'est pas déjà fait) vous pourrez passer à la suite.
 +
 
 +
== Qu'est il arrivé au code Python d'Adafruit!? ==
 +
Par le passé, tout le code Python des bibliothèques Adafruit était disponible dans un unique dépôt GitHub localisé sur [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git]
 +
 
 +
Par le passé, le dépôt '''Adafruit-Raspberry-Pi-Python-Code.git''' maintenant tout le code publié par Adafruit. Il contenait le code pour communiquer avec un senseur comme le BMP085, TCS34725 ou autre matériel comme l'afficheur LCD d'Adafruit. Avec le temps, Adafruit à fini par se rendre compte qu'il était difficile de maintenir autant de code dans un seul dépôt. Il était également difficile de passer {{underline|tout ce code d'un seul tenant}} dans PiP (''Python package index'') pour en simplifier l'installation.
 +
 
 +
En conséquence, Adafruit à scindé l'ancienne bibliothèque Python en dépôt individuels. Ensuites, ces dépôts ont été chargés dans l'index "Python package index" de sorte qu'il est possible de réaliser simplement des installations avec '''la commande pip'''.
 +
 
 +
{{ambox|text=Notez que pip n'installe pas les codes d'exemples. Il est donc recommandé, a la plupart des utilisateurs, d'installer les sources).}}
   −
<nowiki>sudo apt-get install git</nowiki>
+
Le dépôt GitHub [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git] contient une liste des bibliothèques installable avec pip.
   −
Once git is installed (if its not already there) make yourself a suitable directory to contain all the Python code that you are going to install. Now 'cd' into that directory and then issue the following commands in LX Terminal.
+
Toutes les bibliothèques Python supportent Python 2.7 et Python 3.x! Notez que si vous comptez utiliser Python 3, ce dernier dispose de bibliothèques totalement séparées des bibliothèques Python 2. Vous pourriez donc avoir besoin d'installer les bibliothèques pour Python 2 et Python 3. Voyez la vidéo YouTube suivante pour plus de détails:
 +
* [https://www.youtube.com/watch?v=rRFG32EebNc https://www.youtube.com/watch?v=rRFG32EebNc] (''Adafruit, Anglais'')
   −
<nowiki>git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
+
Pour un support Python 3 sur Raspberry Pi, il sera nécessaire d'installer Python 3, PIP pour Python 3 et la bibliothèque RPi.GPIO (utilisée pour contrôler les GPIO du Pi). Exécutez les commandes suivantes:
cd Adafruit-Raspberry-Pi-Python-Code
  −
ls</nowiki>
      +
<syntaxhighlight lang="bash">
 +
# Support Python 3 sur Raspberry-Pi
 +
sudo apt-get update
 +
sudo apt-get install -y python3 python3-pip python-dev
 +
sudo pip3 install rpi.gpio
 +
</syntaxhighlight>
    +
== Liste des bibliothèques Adafruit ==
 +
Après avoir lu la section précédente, vous savez maintenant que les différentes bibliothèques Adafruit peuvent être installées avec la commande '''pip''' ou '''pip3'''.
   −
If there is any problem during any of the steps above, you will see an error message. The most common reasons why something should fail to install are:
+
Vous trouverez le nom paquets PIP sur la suivante liste maintenue par Adafruit:
* a problem with your Internet connections
+
* [https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code#where-do-i-find-the-new-raspberry-pi-python-code https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code#where-do-i-find-the-new-raspberry-pi-python-code]
* a mis-typed command. Remember everything in Linux is case sensitive. It is best to open this page on your Raspberry Pi so you can just copy and paste the commands.
     −
You will find all sorts of goodies in here, many of which we will use in later tutorials.
+
Elle se présente comme suit:
    +
[[Fichier:Rasp-Hack-GPIO AdaFruit PiCode-liste.png|640px]]
    
{{Rasp-Hack-GPIO-TRAILER}}
 
{{Rasp-Hack-GPIO-TRAILER}}
29 918

modifications

Menu de navigation