Modifications

Sauter à la navigation Sauter à la recherche
438 octets ajoutés ,  26 mars 2017 à 13:20
Ligne 113 : Ligne 113 :     
== Console Pycom ==
 
== Console Pycom ==
To start coding, simply go to the Pycom Console and type your code. Lets try to make the LED light up.
+
Pour coder rapidement, démarrez simplement la console Pycom Console et saisissez votre code.  
   −
<syntaxhighlight lang="python">
+
Nous allons essayer d'allumer la LED.
import pycom # we need this module to control the LED
+
 
pycom.heartbeat(False) # disable the blue blinking
+
<0syntaxhighlight lang="python">
pycom.rgbled(0x00ff00) # make the LED light up in green color
+
import pycom # nous avons besoin de ce module pour controler la LED
 +
pycom.heartbeat(False) # desactiver le clognotement de la LED bleue
 +
pycom.rgbled(0x00ff00) # allumer la LED en vert
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
Change the color by adjusting the hex RGB value
+
Changer la couleur en utilisant une valeur RGB en hexadécimal
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
pycom.rgbled(0xff0000) # now make the LED light up in red color
+
pycom.rgbled(0xff0000) # allumer la LED en rouge
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
The console can be used to run any python code, also functions or loops. Simply copy-paste it into the console or type it manually. Note that after writing or pasting any indented code like a function or a while loop, you’ll have to press enter up to three times to tell MicroPython that you’re closing the code (this is standard MicroPython behavior).
+
La console peut être utilisée pour exécuter du code python, des fonctions et des boucles. Faites un simple copier/coller dans la console ou saisissez du code manuellement.  
 +
 
 +
{{underline|Note:}} après avoir écrit ou avoir collé du code ayant des indentations (comme des fonctions ou des boucles), il sera nécessaire de presser 3x la touche de retour clavier (Enter) pour indiquer à MicroPython que vous avez terminé la saisie (c'est une fonctionnalité standard de MicroPython).
    
[[Fichier:Hack-pycom-lopy-Pymakr-30.png]]
 
[[Fichier:Hack-pycom-lopy-Pymakr-30.png]]
   −
Use {{fname|print()}} to output contents of variables to the console for you to read. Returned values from functions will also be displayed if they are not caught in a variable. This will not happen for code running from the main or boot files. Here you need to use print() to output to the console.
+
Vous pouvez utiliser la fonction {{fname|print()}} pour afficher du contenu (des sorties) dans la console. Pratique pour afficher le contenu d'une variable les valeurs retournées par des fonctions, des messages dans la console durant le fonctionnement de votre programme.
 +
 
 +
Par contre, cela ne se produira pas pour du code exécuté depuis les fichiers main.py et boot.py .  
   −
A few pycom-console features you can use:
+
Voici quelques fonctionnalités utilisable dans la console pycom:
   −
* '''Input history''': use arrow up and arrow down to scroll through the history
+
* '''Historique de saisie''': utilisez les flèches haut et bas pour afficher les dernières saisies dans la console
* '''Tab completion''': press tab to auto-complete variables or module names
+
* '''Complétion''': Pressez la touche de tabulation "Tab" pour compléter automatiquement le nom des variables et des modules
* '''Stop any running code''': with ctrl-c
+
* '''Arrêter l'exécution du code''': en pressant la combinaison de touche ctrl-c
* '''Copy/paste code or output''': ctrl-c and ctrl-v (cmd-c and cmd-v for mac)
+
* '''Copier/coller de code ou sortie''': ctrl-c et ctrl-v (cmd-c et cmd-v sur mac) pour copier/coller du contenu
    
== Connectez pymakr sur vos cartes ==
 
== Connectez pymakr sur vos cartes ==
29 917

modifications

Menu de navigation