Modifications

Sauter à la navigation Sauter à la recherche
1 078 octets ajoutés ,  18 mars 2014 à 12:17
Ligne 87 : Ligne 87 :     
== Un dernier élément ==
 
== Un dernier élément ==
Our “retrogame” utility is the software glue that joins these keyboard-driven games to our GPIO-connected controls.
+
Notre utilitaire “retrogame” est la partie logicielle qui permet de "brancher ensemble" les jeux pilotés par clavier avec nos contrôles d'arcade branchés sur le GPIO.
   −
[https://github.com/adafruit/Adafruit-Retrogame Download retrogame from GitHub]. Select the “download ZIP” button and uncompress this file on your Raspberry Pi.
+
[https://github.com/adafruit/Adafruit-Retrogame Télécharger ''retrogame'' depuis GitHub] en sélectionnant le bouton "download ZIP" et décompressez ensuite le fichier sur votre Raspberry Pi.
   −
'''A pre-built version of retrogame is included in the ZIP file. If using the joystick and button layout described above, this program can be used as-is'''. Otherwise, the C source code needs some editing, and you’ll need to compile it (a Makefile is provided) after making changes. The GPIO pin to keyboard remapping is currently handled with a table in the source…this should be edited to match your unique wiring setup.
+
'''Une version pré-compilée de ''retrogame'' est inclus dans le fichier ZIP. Ce programme peut être utilisé comme tel, si vous utilisez le joystick et les boutons comme décrit ci-dessus'''. Sinon, vous pouvez adapter le code source écrit en C et vous aurez besoin de le compiler (avec le Makefile fourni dans l'archive) après avoir réalisé vos modifications. La correspondant "broche GPIO" <-> "Touche clavier" est maintenu dans le code source à l'aide d'une table (array)... cette table doit être modifié pour correspondre à votre propre raccordement sur le GPIO.
    
  <nowiki>cd Adafruit-Retrogame
 
  <nowiki>cd Adafruit-Retrogame
 
nano retrogame.c</nowiki>
 
nano retrogame.c</nowiki>
   −
(Of course you can substitute your editor of preference there “nano” is easier for beginners.)
+
(Vous pouvez bien entendu utiliser l'éditeur de votre choix "nano" est juste plus approprié pour les débutants.)
   −
Starting around line 77 you’ll see a table resembling this:  
+
Vous trouverez ensuite le code suivant aux alentours de la ligne 77...  il s'agit de la déclaration et initialisation de la table (array) "io":  
    
  <nowiki>struct {
 
  <nowiki>struct {
Ligne 112 : Ligne 112 :  
         {  7,      KEY_LEFTALT  }
 
         {  7,      KEY_LEFTALT  }
 
};</nowiki>
 
};</nowiki>
 +
 +
<small>Note de MCHobby:<br />
 +
Les constantes (KEY_LEFT,...) correspondant aux touches provient du fichier d'entête input.h. Ces constantes sont en anglais (un standard international). Voici quelques termes de base pour vous aider à comprendre:
 +
* KEY : clé... comprenez touche
 +
* LEFT, RIGHT: Gauche, Droite (KEY_LEFT symbolise la touche gauche... la flèche de déplacement curseur vers la gauche)
 +
* UP, DOWN: Haut, bas
 +
* CTRL: la touche "ctrl" dit 'Contrôle'.
 +
* ALT: la touche "alt". KEY_LEFTALT correspond donc à la "touche alt à gauche" sur le clavier.
 +
N'hésitez pas à consulter le contenu du fichier ''input.h'' dans le répertoire {{code|/usr/include/linux/}} pour découvrir les autres touches mises à votre disposition)</small>
    
Each line in this table contains two elements. The first is a GPIO pin number (where a button or one direction from a joystick is attached), the second is the corresponding key code to be generated by this control. A list of valid key code names can be found in the file /usr/include/linux/input.h starting around line 178. Remember to enclose each pin/key pair in {curly braces} with a comma between them.
 
Each line in this table contains two elements. The first is a GPIO pin number (where a button or one direction from a joystick is attached), the second is the corresponding key code to be generated by this control. A list of valid key code names can be found in the file /usr/include/linux/input.h starting around line 178. Remember to enclose each pin/key pair in {curly braces} with a comma between them.
29 918

modifications

Menu de navigation