Modifications

Sauter à la navigation Sauter à la recherche
1 183 octets ajoutés ,  17 septembre 2018 à 11:08
Ligne 100 : Ligne 100 :     
[[Fichier:FEATHER-MICROPYTHON-OLED-20a.jpg|320px]]
 
[[Fichier:FEATHER-MICROPYTHON-OLED-20a.jpg|320px]]
 +
 +
==== Rectangle ====
 +
Dessiner un rectangle (à 3 pixels du bord).
 +
 +
<syntaxhighlight lang="python">
 +
lcd.fill(0) # Rempli l'écran en noir
 +
# Dessine un rectangle en blanc
 +
# rect( x, y, w, h, c )
 +
lcd.rect( 3, 3, 128-2*3, 32-2*3, 1 )
 +
lcd.show()  # Afficher!
 +
</syntaxhighlight>
 +
 +
[[Fichier:FEATHER-MICROPYTHON-OLED-20b.jpg|320px]]
 +
 +
==== Lignes (Horiz. et Vert.) ====
 +
La bibliothèque dispose de méthodes optimisées pour dessiner des lignes Horizontales et verticales.
 +
 +
<syntaxhighlight lang="python">
 +
lcd.fill(0) # Rempli l'écran en noir
 +
# Dessine des lignes en blanc.
 +
# Ligne horizontale hline( x,y, w, c )
 +
#  donc fournir la largeur.
 +
# Ligne verticale vline( x,y, h, c )
 +
#  donc fournir la hauteur.
 +
lcd.hline( 0, 18, 128, 1 )
 +
lcd.vline( 64, 0, 32, 1 )
 +
lcd.show()  # Afficher!
 +
</syntaxhighlight>
 +
 +
[[Fichier:FEATHER-MICROPYTHON-OLED-20c.jpg|320px]]
 +
 +
==== Lignes ====
 +
Le tracé de ligne se fait sans anti-aliasing.
 +
 +
<syntaxhighlight lang="python">
 +
lcd.fill(0) # Rempli l'écran en noir
 +
# Dessine des lignes en blanc.
 +
# line(x1,y1,x2,y2,c)
 +
lcd.line(0,0,128,32,1)
 +
lcd.line(0,32,128,0,1)
 +
lcd.show()  # Afficher!
 +
</syntaxhighlight>
 +
 +
[[Fichier:FEATHER-MICROPYTHON-OLED-20d.jpg|320px]]
    
== Où acheter ==
 
== Où acheter ==
 
* {{pl|846|Feather ESP8266}}  
 
* {{pl|846|Feather ESP8266}}  
 
* {{pl|879|OLED FeatherWing 128x32 Pixels (ADA-2900) }}
 
* {{pl|879|OLED FeatherWing 128x32 Pixels (ADA-2900) }}
29 918

modifications

Menu de navigation