Outils pour utilisateurs

Outils du site


documentation:tz51_liquidcrystal

TZ51_LiquidCrystal Library for Arduino

Voir en Français

Vous avez apprécié cet article ? Partagez le !

Uptaded on 28 oct 2018 by Grosse Christophe (Technozone51) http://www.technozone51.fr

This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. This library take care of UTF-8 encoded characters such as the French accentuated characters. This special characters are dynamicaly created as they are used on your screen. Only 8 different special characters can be used on one screen. When the screen is cleared, the previous special characters are destroyed and you can use 8 other characters on the next screen.

Download the TZ51_LiquidCrystal library and install it in the libraries folder of your Arduino IDE.

Use this library as the standard LiquidCrystal library. The only thing to change in your sketch is the include declaration of the library. you must replace

#include <LiquidCrystal.h>

by this

#include <TZ51_LiquidCrystal.h>

For more information about using this library please visit http://www.arduino.cc/en/Reference/LiquidCrystal

Warning ! : Sometime, you must save your sketch before compiling it to force the editor to UTF-8 encode the accentuated characters ! If your LCD displays garbage save the sketch and recompil it.

Example code

ReturnOfAccent.ino
/*
  TZ51_LiquidCrystal Library example - Return of accent
 
 Demonstrates the use a 16x2 LCD display.  Based on LiquidCrystal
 library that works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface. This library take care of 
 UTF-8 encoded characters such as the French accentuated characters. 
 This special characters are dynamicaly created as they are used in your
 screen. Only 8 different special charcaters can be used on one screen.
 When the screen is cleared, the previous special characters are destroyed
 and you can use 8 other characters on the next screen.
 
 This sketch prints some screens with special characters : French accentuated
 characters to the LCD
 
 
WARNING ! Sometime, you must save your sketch before compiling it to force the 
editor to UTF-8 encode the accentuated characters ! If your LCD displays garbage
save the sketch and recompil it.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * LCD VSS pin to ground
 * LCD VCC pin to 5V
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 modified 7 Nov 2016
 by Arturo Guadalupi
 modified 28 Oct 2018 
 by Grosse Christophe (technozone51) ( http://wwww.technozone51.fr ). Dynamic creation of French Accentued 
 Characters.
 
 This example code is in the public domain.
 
 http://www.technozone51.fr/dokuwiki2/doku.php?id=documentation:tz51_liquidcrystal&#example_code
 
 
*/
 
// include the library code:
#include <TZ51_LiquidCrystal.h>
 
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
 
void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2); 
}
 
void loop() {
  lcd.print(" ¤ Technozone51");
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  lcd.print("   présente ...");
  delay(5000);
  //When cleared, previous special characters are automaticaly destroyed. 
  //You can then use 8 other special characters on the next screen.
  lcd.clear();
  lcd.print(" le retour des");
  lcd.setCursor(0, 1);
  lcd.print("accents : àâäãñ");
  delay(5000);
  lcd.clear();
  lcd.print("mais aussi ...");
  lcd.setCursor(0, 1);
  lcd.print("  éèêëîïôö");
  delay(5000);
  lcd.clear();
  lcd.print("et puis ...");
  lcd.setCursor(0, 1);
  lcd.print("   üûùç°€");
  delay(5000);
  lcd.clear();
  lcd.print("Pour écrire en");
  lcd.setCursor(0, 1);
  lcd.print("Français !  Ex:");
  delay(5000);
  lcd.clear();
  lcd.print("Prix : 0.00 €");
  lcd.setCursor(0, 1);
  lcd.print("Temp : 18.5°C");
  delay(5000);
  lcd.clear();
  lcd.print("L'astéroïde");
  lcd.setCursor(0, 1);
  lcd.print("célèbre");
  delay(5000);
  lcd.clear();
}

License

Copyright © 2006-2008 Hans-Christoph Steiner. All rights reserved. Copyright © 2010 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

documentation/tz51_liquidcrystal.txt · Dernière modification: 2018/10/29 18:04 par admin