Compte Rendu Arduino
Compte Rendu Arduino
code
// include the library code:
#include <LiquidCrystal.h>
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
print()
Description
Prints text to the LCD.
Syntax
lcd.print(data)
lcd.print(data, BASE)
Parameters
lcd: a variable of type LiquidCrystal
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