Modifications

Sauter à la navigation Sauter à la recherche
753 octets ajoutés ,  16 décembre 2017 à 22:19
aucun résumé de modification
Ligne 2 : Ligne 2 :     
== Introduction ==
 
== Introduction ==
{{traduction}}
  −
   
CircuitPython envoi la sortie d'un fichier .py en cours d'exécution vers la connexion USB-série. Par conséquent, il est nécessaire de se connecter sur la carte avec un câble console pour voir l'affichage des commandes {{fname|print}} et des erreurs.
 
CircuitPython envoi la sortie d'un fichier .py en cours d'exécution vers la connexion USB-série. Par conséquent, il est nécessaire de se connecter sur la carte avec un câble console pour voir l'affichage des commandes {{fname|print}} et des erreurs.
   Ligne 23 : Ligne 21 :  
{{ADFImage|FEATHER-M0-MicroPython-REPL-01.png}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-01.png}}
   −
=== Install Serial Port Terminal Software ===
+
=== Installer un logiciel terminal ===
'''On Windows''' you'll want to use a tool like [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] to connect to the serial port.  Download and run PuTTY, then configure it to use a serial connection to the board's COM port at 115200 baud similar to as shown below:
+
'''Sur Windows''' vous aurez besoin d'utilise un outil comme [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] pour vous connecter sur le port série de la carte. Télécharger et exécuter PuTTY, puis configurez le pour utiliser la connexion série de carte identifié ci-dessus (à 115200 baud). Comme indiqué ci-dessous:
    
{{ADFImage|FEATHER-M0-MicroPython-REPL-02.png}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-02.png}}
   −
After clicking '''Open''' you should see a new window pop up with the current output from the running code. If no code is running, it may be blank so hit '''Ctrl - C''' to get to the REPL prompt.
+
Après avoir cliqué sur le bouton de connexion, vous devriez vois une nouvelle fenêtre s'ouvrir, cette dernière affiche les messages produits par le programme en cours d'exécution. Il se peut que l'écran reste vide s'il n'y a pas de code en cours d'exécution, pressez simplement les touches '''Ctrl - C''' pour obtenir l'invite de commande REPL (>>>).
    
{{ADFImage|FEATHER-M0-MicroPython-REPL-03.png|640px}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-03.png|640px}}
   −
== Mac OSX and Linux ==
+
== Sur Mac OSX et Linux ==
Connecting to the serial terminal on is more straightforward than on Windows. Neither OS requires additional drivers.
+
La connexion avec un terminal série est plus facile que sur Windows. Aucun des deux systèmes d'exploitation ne requière d'installation de pilote.
   −
First open a terminal program. On Mac OSX, Terminal comes installed and [https://www.iterm2.com/ iTerm2] can be downloaded. On Linux there are a variety available such as gnome-terminal (called Terminal) and Konsole on KDE.
+
Commencez par ouvrir un terminal. Sur Mac OSX, Terminal est déjà installé et vous pouvez télécharger [https://www.iterm2.com/ iTerm2]. Il y a de nombreux terminaux disponibles tel que gnome-terminal (appelé Terminal) et Konsole sur KDE.
   −
Now before plugging in the board, type <code>ls /dev/tty.*</code> to view existing serial connections.
+
Maintenant, saisissez la commande {{fname|ls /dev/tty*}} avant de brancher la carte. Cela permet de voir les connexions séries existantes.
    
{{ADFImage|FEATHER-M0-MicroPython-REPL-04.png|480px}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-04.png|480px}}
   −
Next, plug in the board. There should be one new serial connection that is for your board. Typically on Mac OSX its something like <code>/dev/tty.usbmodem*</code> and on Linux its <code>/dev/ttyACM*</code>.
+
Ensuite, branchez la carte. Il devrait y avoir une nouvelle connexion série associée à la carte, connexion que vous pouvez identifier avec {{fname|ls /dev/tty*}}. Sur Mac OSX cela devrait ressembler à ceci {{fname|/dev/tty.usbmodem*}} et sur Linux, cela devrait ressembler à {{fname|/dev/ttyACM*}} .
    
{{ADFImage|FEATHER-M0-MicroPython-REPL-05.png|480px}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-05.png|480px}}
   −
Now that we know the device name, the <code>screen</code> command can be used to connect to the serial port. Its installed on Mac OSX by default but Linux users may need to install it using their package manager. Run the following command to connect at 115200 baud:
+
Maintenant que nous connaissons le nom de périphérique associé à la carte, nous pouvons utiliser la commande {{fname|screen}} pour se connecter sur sur le port série. Screen est disponible par défaut sur un Mac OSX, les utilisateurs Linux pourraient avoir besoin de l'installer en utilisant le gestionnaire de paquet/logiciel de la distribution.  
 +
 
 +
Exécutez la commande suivante pour établir une connexion à 115200 baud:
    
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
screen /dev/tty.board_name 115200
+
screen /dev/tty_nom_peripherique 115200
 
</syntaxhighlight>
 
</syntaxhighlight>
    +
où '''/dev/tty_nom_peripherique''' est le nomd du périphérique série associé à la carte.
   −
Where '''/dev/tty.board_name''' is the name of the board's serial port.
+
Lorsque vous utilisez "screen", il est possible de le quitter en pressant les touches '''Ctrl-a''' puis '''k''' puis '''y''' (pour Oui) -OU- en pressant '''Ctrl-a''' puis en saisissant ''':quit''' suivit d'un retour clavier.
 
  −
When you're done using screen most versions of it allow you to exit by pressing '''Ctrl-a''' then '''k''' then '''y '''or pressing '''Ctrl-a''' then typing ''':quit''' and pressing '''enter'''.
      
{{ADFImage|FEATHER-M0-MicroPython-REPL-06.png|480px}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-06.png|480px}}
   −
== Using the REPL ==
+
== Utiliser REPL ==
After you're connected to the serial REPL try pressing enter to confirm you see the '''>>>''' prompt.  You can also type '''help()''' and press enter on most boards to see basic usage information.
+
Une fois connecté en REPL série essayez de presser le retour clavier pour afficher l'invite de commande '''>>>''' s'il n'est pas encore visible.  vous pouvez saisir '''help()''' (suite d'un retour clavier) pour voir les informations d'usage sur la carte.
    
{{ADFImage|FEATHER-M0-MicroPython-REPL-07.png|480px}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-07.png|480px}}
   −
If you can't get a '''>>>''' prompt to appear try pressing '''Ctrl-c''' a couple times to interrupt any running program on the board.
+
Si vous ne voyez pas d'invite '''>>>''' essayez de presser '''Ctrl-c''' une ou plusieur fois pour interrompre le programme en cours d'exécution sur la carte.
   −
You might get a '''Traceback''' and '''KeyboardInterrupt''' that lets you know the current Python program has stopped, and you'll get a prompt:
+
Vous alors obtenir un '''Traceback''' ou'''KeyboardInterrupt''' qui vous informe que le programme Python actuel est arrêté, et vous obtiendrez une invitation:
    
{{ADFImage|FEATHER-M0-MicroPython-REPL-08.png|480px}}
 
{{ADFImage|FEATHER-M0-MicroPython-REPL-08.png|480px}}
   −
That's all there is to connecting to the board's serial REPL, you're ready to start typing in and running CircuitPython code!
+
Voilà, c'est tout ce qu'il y a à savoir pour établir une connexion REPL. Vous êtes prêt à saisir vos instructions MicroPython et exécuter vos programmes CircuitPython!
 
      
{{FEATHER-M0-EXPRESS-TRAILER}}
 
{{FEATHER-M0-EXPRESS-TRAILER}}
29 918

modifications

Menu de navigation