Modifications

Sauter à la navigation Sauter à la recherche
Ligne 136 : Ligne 136 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
You should see a description of each function on the LCD class, including some functions not shown in the example:
+
Vous devriez voir la description de chaque fonction de la classe LCD, y compris les fonctions non utilisées dans l'exemple:
    
  autoscroll(autoscroll)
 
  autoscroll(autoscroll)
   −
Autoscroll will 'right justify' text from the cursor if set True, otherwise it will 'left justify' the text.
+
Autoscroll fera 'une justification à droite' à partir du curseur (si le paramètre est à ''True''), sinon le texte est 'justifié à gauche'.
    
  enable_display(enable)
 
  enable_display(enable)
   −
Enable or disable the display. Set enable to True to enable.
+
Active ou désactive l'afficheur. Placez le paramètre à True pour activer l'écran.
    
  home()
 
  home()
   −
Move the cursor back to its home (first line and first column).
+
Déplace le curseur à la poisition "home" (première ligne, première colonne).
    
  set_backlight(backlight)
 
  set_backlight(backlight)
   −
Enable or disable the backlight. If PWM is not enabled (default), a non-zero backlight value will turn on the backlight and a zero value will turn it off. If PWM is enabled, backlight can be any value from 0.0 to 1.0, with 1.0 being full intensity backlight.
+
Active ou désactivé le rétro-élcairage. SI la sortie PWM n'est pas active (comportement par défaut) ALORS une valeur supérieure à 0 activera le réstro-élcairage SINON une valeur égale à zero désactive le rétro-élcairage. Si le signal PWM est activé alors le le rétro-éclairage peut être contrôlé en utilisant une valeur entre 0.0 et 1.0, avec la valeur 1.0 étant l'intensité maximale du rétro-élcairage.
    
  set_cursor(col, row)
 
  set_cursor(col, row)
   −
Move the cursor to an explicit column and row position.
+
Déplace le curseur sur une colonne (''column'') et ligne (''row'') explicite.
   −
Finally, the last portion of the '''char_lcd.py''' script:
+
Pour finir, la dernière portion du script '''char_lcd.py''':
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
# Demo scrolling message right/left.
+
# Demo du defillement de message de droite/gauche.
 
lcd.clear()
 
lcd.clear()
 
message = 'Scroll'
 
message = 'Scroll'
Ligne 172 : Ligne 172 :  
lcd.move_left()
 
lcd.move_left()
   −
# Demo turning backlight off and on.
+
# Demo activer et desactiver le retro-eclairage.
 
lcd.clear()
 
lcd.clear()
 +
# Message: flash du retro-eclairage dans 5 secondes
 
lcd.message('Flash backlight\nin 5 seconds...')
 
lcd.message('Flash backlight\nin 5 seconds...')
 
time.sleep(5.0)
 
time.sleep(5.0)
# Turn backlight off.
+
# eteindre le retro-eclairage.
 
lcd.set_backlight(0)
 
lcd.set_backlight(0)
 
time.sleep(2.0)
 
time.sleep(2.0)
# Change message.
+
# Changer le message.
 
lcd.clear()
 
lcd.clear()
 
lcd.message('Goodbye!')
 
lcd.message('Goodbye!')
# Turn backlight on.
+
# activer le retro-eclairage.
 
lcd.set_backlight(1)
 
lcd.set_backlight(1)
 
</syntaxhighlight>
 
</syntaxhighlight>
   −
You can see how the {{fname|move_right}} and {{fname|move_left}} functions are used to scroll the display, and further down how the {{fname|set_backlight}} function turns off and on the backlight.
+
Vous pouvez voir comment les fonctions {{fname|move_right}} et {{fname|move_left}} sont utilisées pour faire défiler l'affichage... et plus bas dans le code, les appels à la fonction {{fname|set_backlight}} pour allumer et éteindre le rétro-éclairage.
    
That's all there is to using the '''Adafruit_CharLCD''' class!
 
That's all there is to using the '''Adafruit_CharLCD''' class!
29 917

modifications

Menu de navigation