// Exemples d'affichage avec shield LCD Arduino
// Inclusion de la librairie pour afficheur LCD
#include <LiquidCrystal.h>
// Initialise le LCD en mode 4 bits, R/W non utilise. Syntaxe: LiquidCrystal lcd (RS, E, D4, D5, D6, D7)
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
// Definit une constante de type tableau de 8 lignes de mots de 5 bits, appelee "caractere_special"
byte caractere_special[8] = {
0b10101,
0b01110,
0b11011,
0b10101,
0b10101,
0b11011,
0b01110,
0b10101
};
void setup() {
lcd.begin(16, 2);
lcd.write(0b11110100); // ou lcd.write(0xF4) pour le caractère omega
lcd.setCursor(3,0);
lcd.print("255");
lcd.createChar(1,caractere_special);
lcd.setCursor(7,1);
lcd.write(1);
delay(1000);
for (int positionCounter = 0; positionCounter < 8; positionCounter++) { //
lcd.scrollDisplayRight(); //
delay(400);
}
for (int positionCounter = 0; positionCounter < 8; positionCounter++) { //
lcd.scrollDisplayLeft(); //
delay(400);
}
}
void loop() {
}