Ligne 28 : |
Ligne 28 : |
| * {{fname|printRight()}} - ''pas de documentation disponible'' | | * {{fname|printRight()}} - ''pas de documentation disponible'' |
| | | |
− | == print() == | + | == print() sur LCD 16x2 == |
− | Voici un exemple qui décris le comportement de plusieurs instructions {{fname|lcd.print()}} sur un écran lcd 16x2. | + | Voici un exemple qui décris le comportement de plusieurs instructions {{fname|lcd.print()}} sur un {{pl|176|écran lcd 16x2}}. |
| | | |
| <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
Ligne 56 : |
Ligne 56 : |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | Ce qui produit le résultat suivant: | + | Ce qui produit le résultat suivant sur un écran LCD 16x2 |
| | | |
| <nowiki>Hello voici un texte vraiment t | | <nowiki>Hello voici un texte vraiment t |
| !ffff!eeeef!1231</nowiki> | | !ffff!eeeef!1231</nowiki> |
| + | |
| + | == Print() sur LCD 20x4 == |
| + | Voici un autre exemple d'affichage sur un LCD 20x4 . |
| + | |
| + | <syntaxhighlight lang="c"> |
| + | #include <Wire.h> |
| + | #include <LiquidCrystal_I2C.h> |
| + | |
| + | // Ecran LCD branché sur la backpack LCD I2C (a l'adresse 0x27) |
| + | // Dimension de l'écran 20 caractères par ligne, 4 lignes |
| + | LiquidCrystal_I2C lcd(0x27,20,4); |
| + | |
| + | void setup() |
| + | { |
| + | // Initialize l'ecran |
| + | lcd.init(); |
| + | |
| + | // Affiche des messages sur l'ecran |
| + | lcd.backlight(); |
| + | lcd.home(); |
| + | lcd.print("LCD 20x4 Blanc/Bleu"); |
| + | lcd.setCursor(0,1); // colonne, ligne |
| + | lcd.print("Disponible chez"); |
| + | lcd.setCursor(7,2); |
| + | lcd.print("MC Hobby Sprl"); |
| + | lcd.setCursor(0,3); |
| + | lcd.print("--shop.mchobby.be--"); |
| + | } |
| + | |
| + | void loop() |
| + | { |
| + | delay( 1000 ); |
| + | } |
| + | </syntaxhighlight> |
| + | |
| + | [[Fichier:LCD-I2C-Fonctions-20.jpg|640px]] |
| | | |
| {{LCD-I2C-TRAILER}} | | {{LCD-I2C-TRAILER}} |