Modifications

Sauter à la navigation Sauter à la recherche
1 716 octets ajoutés ,  26 mars 2017 à 15:45
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{LOPY-NAV}}
 
{{LOPY-NAV}}
  −
{{traduction}}
      
== Pymakr - présentation ==
 
== Pymakr - présentation ==
Ligne 62 : Ligne 60 :     
=== Ajouter des fichiers ===
 
=== Ajouter des fichiers ===
{{traduction}}
+
Si vous créez directement des fichiers (et répertoires) dans le répertoire de votre projet, il faudra faire en sorte que Pymakr soit au courant de l'existence de ces fichiers pour faire la synchronisation avec votre périphérique de développement.
If you create any files (and folder) to your project directory from outside of pymakr, they won’t appear in your project files. To add them, right-click on the left sidebar in the Project-Viewer when you have your project open, and click ‘Add source files’.
+
 
 +
Pour les ajouter, ouvrez votre projet puis faites un clique-droit sur le bandeau gauche (sidebar) de l'explorateur de projet (''Project-Viewer'').
 +
 
 +
Ensuite, sélectionnez l'option "Add source files" (''Ajouter des fichiers sources'') dans le menu contextuel.
    
[[Fichier:Hack-pycom-lopy-Pymakr-10.png]]
 
[[Fichier:Hack-pycom-lopy-Pymakr-10.png]]
   −
In the popup that appears, click the folder icon next to the ‘Source files’ input and select one or more files to be included.
+
Cela affichera une fenêtre de sélection de fichier nommée "Source files" (''fichier source'') où vous pourrez sélectionner un ou plusieurs fichier à inclure dans votre projet.
    
[[Fichier:Hack-pycom-lopy-Pymakr-11.png]]
 
[[Fichier:Hack-pycom-lopy-Pymakr-11.png]]
   −
Adding a folder works in the exact same way, using the ‘Add source directory’ after right-clicking in the project sidebar. All files inside the chosen directories will be added as well.
+
Il est également possiblé d'ajouter un répertoire (exactement comme un fichier) en utilisant l'option "Add source directory" (''ajouter un répertoire source'') dans le menu contextuel. Tous les fichiers disponibles dans le répertoire sélectionné seront également ajoutés.
    
== Sans créer de projet ==
 
== Sans créer de projet ==
If you just want to test some code on the module without creating a Project, you can create a new file or open an existing one and press the ‘run’ button.
+
Si vous avez simplement besoin de tester du code sans créer de projet, vous pouvez créer un nouveau fichier (ou ouvrir un fichier existant) puis presser le bouton "run" (''exécuté'').
   −
Note that the changes you make to your file won’t be automatically saved to the device on execution.
+
Notez que, dans ce cas, les modifications effectuées ne seront pas automatiquement sauvé sur le périphérique au moment de l'exécution.
    
== Un exemple simple ==
 
== Un exemple simple ==
For fun, lets try to build a traffic light. Add the following code to the {{fname|main.py}} file:
+
Nous allons maintenant réaliser un feux de signalisation tricolore pour nous amuser.  
 +
 
 +
Ajouter le code suivant dans votre fichier {{fname|main.py}} :
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
Ligne 85 : Ligne 88 :  
import time
 
import time
 
pycom.heartbeat(False)
 
pycom.heartbeat(False)
for cycles in range(10): # stop after 10 cycles
+
for cycles in range(10): # arreter apres 10 cycles
     pycom.rgbled(0x007f00) # green
+
     pycom.rgbled(0x007f00) # vert
 
     time.sleep(5)
 
     time.sleep(5)
     pycom.rgbled(0x7f7f00) # yellow
+
     pycom.rgbled(0x7f7f00) # jaune
 
     time.sleep(1.5)
 
     time.sleep(1.5)
     pycom.rgbled(0x7f0000) # red
+
     pycom.rgbled(0x7f0000) # rouge
 
     time.sleep(4)
 
     time.sleep(4)
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
* Make sure the connection to your board is open in the Pycom Console
+
* Vérifiez que la connexion vers votre carte est bien ouverte dans la console Pycom
* Press the sync button on the top toolbar. Any progress will be shown in the console.
+
* Pressez le bouton de synchronisation dans la barre d'outils (vous devriez voir des messages de progression apparaître dans la console).
   −
Here is the expected result:
+
Voici ce que vous devriez voir à l'écran:
    
[[Fichier:Hack-pycom-esp 32-60.gif]]
 
[[Fichier:Hack-pycom-esp 32-60.gif]]
   −
You now have a traffic light in your hands. To stop a running program, use ctrl-c or do a right click on the console and press Reset. You can also reboot the board by pressing the physical {{fname|reset}} button.
+
Voila! vous avez un feux tricolore sous la main. Vous pouvez utiliser la combinaison de touche ctrl-c pour arrêter le programme (ou sélectionner l'option "Reset" dans le menu contextuel de la console).
 +
 
 +
Il est également possible d'arrêter le programme en pressant le bouton "Reset" (réinitialisation physique) de la carte.
   −
{{ambox-stop|text=If your board is running code at boot time, you might need to boot it in safe mode.}}
+
{{ambox-stop|text=Si votre carte exécute le code au démarrage (dans le fichier boot.py), vous pourriez avoir besoin de la démarrer en "Safe mode".}}
    
== 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.  
 +
 
 +
Nous allons essayer d'allumer la LED.
   −
<syntaxhighlight lang="python">
+
<0syntaxhighlight lang="python">
import pycom # we need this module to control the LED
+
import pycom # nous avons besoin de ce module pour controler la LED
pycom.heartbeat(False) # disable the blue blinking
+
pycom.heartbeat(False) # desactiver le clognotement de la LED bleue
pycom.rgbled(0x00ff00) # make the LED light up in green color
+
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.
   −
A few pycom-console features you can use:
+
Par contre, cela ne se produira pas pour du code exécuté depuis les fichiers main.py et boot.py .
   −
* '''Input history''': use arrow up and arrow down to scroll through the history
+
Voici quelques fonctionnalités utilisable dans la console pycom:
* '''Tab completion''': press tab to auto-complete variables or module names
+
 
* '''Stop any running code''': with ctrl-c
+
* '''Historique de saisie''': utilisez les flèches haut et bas pour afficher les dernières saisies dans la console
* '''Copy/paste code or output''': ctrl-c and ctrl-v (cmd-c and cmd-v for mac)
+
* '''Complétion''': Pressez la touche de tabulation "Tab" pour compléter automatiquement le nom des variables et des modules
 +
* '''Arrêter l'exécution du code''': en pressant la combinaison de touche ctrl-c
 +
* '''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 ==
Ligne 157 : Ligne 168 :     
== Interface expert ==
 
== Interface expert ==
By default, Pymakr is configured in ‘lite’ interface. In this mode, a lot of features are hidden and only the basic functionality remains. This makes it very user friendly, but after you become familiar with the software, you might want to switch to ‘expert’ interface to get the most out of Pymakr.
+
Par défaut, Pymakr est consifuré en mode ‘lite’ (interface légère). De nombreuses fonctionnalités sont masquées dans ce mode et seules les fonctionnalités principales restent disponibles.
   −
You can enable expert interface under Settings -> Switch to expert interface. After Pymakr restarts, you’ll get access to a few new options:
+
Cela rend Pymakr très accessible et agréable à utiliser pour une première prise-en-main. Une fois familiarisé avec l'environnement, vous pouvez passer l'interface en mode 'expert' pour disposer de fonctionnalités avancées.
   −
* Full interface control over tabs and layout
+
Vous pouvez activer le mode expert à l'aide du menu "Settings -> Switch to expert interface" (''Paramètres -> Basculer dans l'interface expert''). Après le redémarrage de Pymakr, vous disposerez des nouvelles options suivantes:
* Control over keyboard shortcuts
+
* Un contrôle complet de l'interface (tabulations et layout)
* Export/import of preferences
+
* Contrôle des raccourcis claviers
* Preferenes for the editor
+
* Importation/exportation des préférences
* Extra tabs besides the Pycom Console: A local python shell, a task viewer and a basic number converter.
+
* Configuration des préférences pour l'éditeur
 +
* Onglets complémentaires dans la console Pycom:
 +
** Un shell python local,  
 +
** Visualisation des tâches
 +
** convertisseur numérique.
 
* Bookmarks
 
* Bookmarks
* Plugin controls
+
* Contrôle des greffons (Plugin)
* Lots of other extra’s
+
* Beacoup d'autres extras
   −
To switch back to ‘lite’ mode, go back to Settings and choose Switch to Lite interface.
+
Si vous désirez repasser en mode 'lite', retournez dans le menu "Settings" (''paramètres'') et choisissez l'option 'Switch to Lite interface' (''Basculer sur l'interface légère'').
   −
== Thème et couleur ==
+
== Thèmes et couleurs ==
Pymakr has 2 default themes: Dark and Light. To change the basic style, go to Preferences (Pymakr -> Preferences on the left top, or shortkey cmd-,) and head to the Interface tab. There you’ll find a Style property with with both theme options. Press OK or Apply to change to the new theme.
+
Pymakr dispose de 2 thèmes par défaut: "Dark" et "Light" (respectivement ''Sombre et lumineux''). Pour changer le thème, rendez vous dans le menu des préférences ("Pymakr -> Preferences" en haut à gauche) et sélectionnez le volet "Interface". Vous y trouverez la propriété "Style" avec les deux thèmes en option. Pressez sur "OK" ou "Apply" (''appliquer'') pour changer le thème.
   −
If you are on the Expert interface, the properties screen will also contain an Editor tab. The second to last sub-tab is named Style and contains a lot of options regarding colors and fonts.
+
En mode "Expert", l'écran des propriétés contiendra également un volet "Editor" (''Editeur''). Un second sous-volet nommé "Style" contient de nombreuses options permettant de modifier les couleurs et fonts/police de texte de l'éditeur.
    
[https://docs.pycom.io/pycom_esp32/pycom_esp32/toolsandfeatures.html#themes-and-colors Vous trouverez plus d'information concernant ce point sur la page de Pymakr]
 
[https://docs.pycom.io/pycom_esp32/pycom_esp32/toolsandfeatures.html#themes-and-colors Vous trouverez plus d'information concernant ce point sur la page de Pymakr]
      
{{LOPY-TRAILER}}
 
{{LOPY-TRAILER}}
29 917

modifications

Menu de navigation