Branchement
Vss : il a la fonction de ground pour l’afficheur
VDD :Entrée de source de tension
VO :Utilisé pour le reglage du contraste d’affichage du caractére
RS : Utilisé pour la selection du registre afin d’informer l’afficheur qu’il va recevoir une
commande ou une donnée
RW : defini si on ecrit vers l’afficheur ou on lit depuis celui ci
E/ entré de validation
D0,D1,D2,D3,D4,D5,D6,D7=pin de donné ou seont definit les caracters a afficher
A : anode du retro eclairage de l’afficheur
K : Cathode du retro eclaireur de l’afficheur
code
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset :
lcd.print(millis() / 1000);
}
begin()
Description
Initializes the interface to the LCD screen, and specifies the dimensions (width and
height) of the display. begin() needs to be called before any other LCD library
commands.
Syntax
lcd.begin(cols, rows)
Parameters
lcd: a variable of type LiquidCrystal
cols: the number of columns that the display has
rows: the number of rows that the display has
print()
Description
Prints text to the LCD.
Syntax
lcd.print(data)
lcd.print(data, BASE)
Parameters
lcd: a variable of type LiquidCrystal
data: the data to print (char, byte, int, long, or string)
BASE (optional): the base in which to print numbers: BIN for binary (base 2), DEC
for decimal (base 10), OCT for octal (base 8), HEX for hexadecimal (base 16).
Returns
byte
print() will return the number of bytes written, though reading that number is
optional
rightToLeft()
Description
Set the direction for text written to the LCD to right-to-left (the default is left-to-
right). This means that subsequent characters written to the display will go from
right to left, but does not affect previously-output text.
Syntax
lcd.rightToLeft()
Parameters
lcd: a variable of type LiquidCrystal
See also
leftToRight()
Description
Set the direction for text written to the LCD to left-to-right, the default. This means
that subsequent characters written to the display will go from left to right, but does
not affect previously-output text.
Syntax
lcd.leftToRight()
Parameters
lcd: a variable of type LiquidCrystal
home()
Description
Positions the cursor in the upper-left of the LCD. That is, use that location in
outputting subsequent text to the display. To also clear the display, use
the clear() function instead.
Syntax
lcd.home()
Parameters
lcd: a variable of type LiquidCrystal