Modifications

Sauter à la navigation Sauter à la recherche
Ligne 14 : Ligne 14 :     
{{traduction}}
 
{{traduction}}
{{bloc-etroit|text=When following [[RASP-SENSE-HAT-ASTRO-PI-Premier|the guide]] you will have written a sample program which scrolls text across the LED matrix. The program contains two crucial lines, which import the Astro Pi software and create an {{fname|ap}} object which represents the Astro Pi board.}}
+
{{bloc-etroit|text=En suivant [[RASP-SENSE-HAT-ASTRO-PI-Premier|le guide]], vous avez écrit un exemple de programme qui fait défiler du texte sur la matrice LED. Le programme contient deux lignes cruciales, qui charge (''importe'') le logiciel Astro Pi et crée un objet {{fname|ap}} qui représente la carte Astro Pi.}}
    
  <nowiki>from astro_pi import AstroPi
 
  <nowiki>from astro_pi import AstroPi
Ligne 20 : Ligne 20 :  
ap = AstroPi()</nowiki>
 
ap = AstroPi()</nowiki>
   −
The third line is the one that makes the Astro Pi do something:
+
La 3ieme ligne était celle qui demandait à Astro-Pi de faire quelque chose:
    
  <nowiki>ap.show_message("Hello my name is Tim Peake")</nowiki>
 
  <nowiki>ap.show_message("Hello my name is Tim Peake")</nowiki>
   −
{{bloc-etroit|text=You have probably already discovered that you can easily change the message to your own text, but there are more things that we can do.
+
{{bloc-etroit|text=Vous avez probablement découvert qu'il est facile de changer le message afin d'y placer votre propre texte, mais nous pouvons faire encore plus de choses.
   −
'''1.''' We can expand the {{fname|ap.show_message}} command to include some extra '''parameters''' which will change the behaviour of the message.
+
'''1.''' Nous pouvont étendre la commande {{fname|ap.show_message}} pour inclure quelques '''paramètres''' complémentaires qui modifierons les caractéristiques du message.
 
}}
 
}}
 
{| class="wikitable"
 
{| class="wikitable"
| align="center" style="background:#f0f0f0;"|'''Parameter'''
+
| align="center" style="background:#f0f0f0;"|'''Parametre'''
| align="center" style="background:#f0f0f0;"|'''Effect'''
+
| align="center" style="background:#f0f0f0;"|'''Effets'''
 
|-
 
|-
| scroll_speed ||The scroll_speed parameter affects how quickly the text moves on the screen. The default value is 0.1. The bigger the number, the slower the speed
+
| scroll_speed ||Le paramètre scroll_speed (littéralement ''défilement_vitesse'') modifie la vitesse de défilement du texte sur la matrice. La valeur par défaut est 0.1. Plis le nombre est grand et plus cela ralenti.
 
|-
 
|-
| text_colour ||The text_colour parameter alters the colour of the text and is specified using 3 values for Red, Green, Blue. Each value can be between 0 - 255, so [255,0,255] would be Red + Blue = Purple
+
| text_colour ||Le paramètre text_colour (littéralement ''texte_couleur'') altère la couleur du texte, couleur spécifié avec 3 valeurs Rouge, Vert, Bleu - chacune des valeurs étant entre 0 et 255. Ainsi, [255,0,255] donnera du Rouge + Bleu = pourpre.<small><br />pour votre information, cette notation des couleurs est appelé RGB qui est l'acronyme des mots anglais "Red Green Blue" correspondant respectivement à "Rouge Vert Bleu").</small>
 
|-
 
|-
| back_colour ||The back_colour parameter alters the colour of the background and works in the same way as the text_colour
+
| back_colour ||Le paramètre back_colour (littéralement ''derrière_couleur'') altère la couleur du fond de la matrice et fonctionne exactement comme la paramètre text_colour.<small><br />Back est le diminutif de ''background'' faisant ainsi référence à l'arrière plan (''le fond'')</small>
 
|}
 
|}
   −
So this program would display the text {{fname|Astro Pi is awesome!!}} more slowly, with the text in yellow '''[255,255,0]''' and the background in blue '''[0,0,255]''':
+
Le programme suivant va afficher {{fname|Astro Pi est incroyable!!}} plus lentement, avec un texte en jaune '''[255,255,0]''' (rouge+vert) sur un fond bleu '''[0,0,255]''':
    
  <nowiki>from astro_pi import AstroPi
 
  <nowiki>from astro_pi import AstroPi
Ligne 45 : Ligne 45 :  
ap = AstroPi()
 
ap = AstroPi()
   −
ap.show_message("Astro Pi is awesome!!", scroll_speed=0.05, text_colour=[255,255,0], back_colour=[0,0,255])</nowiki>
+
ap.show_message("Astro Pi est incroyable!!", scroll_speed=0.05, text_colour=[255,255,0], back_colour=[0,0,255])</nowiki>
   −
You could also make the message repeat using a while loop like this:
+
Vous pouvez également répéter le message en utilisant une boucle {{fname|while}} telle que celle-ci:
    
  <nowiki>from astro_pi import AstroPi
 
  <nowiki>from astro_pi import AstroPi
Ligne 54 : Ligne 54 :     
while True:
 
while True:
     ap.show_message("Astro Pi is awesome!!", scroll_speed=0.05, text_colour=[255,255,0], back_colour=[0,0,255])</nowiki>
+
     ap.show_message("Astro Pi est incroyable!!", scroll_speed=0.05, text_colour=[255,255,0], back_colour=[0,0,255])</nowiki>
    
'''2.''' Click File -- Save As, give your program a name e.g. {{fname|loop_text.py}}, then press F5 to run.
 
'''2.''' Click File -- Save As, give your program a name e.g. {{fname|loop_text.py}}, then press F5 to run.
29 918

modifications

Menu de navigation