Hide minor edits - Show changes to markup
The LiquidCrystal library allows you to control 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 example sketch shows how to use the cursor() and noCursor() methods to control an underscore-style cursor.
La librería LiquidCrystal te permite controlar displays LCD que sean complatibles con el driver Hitachi HD44780. Hay muchos de ellos ahí fuera, y puedes comunicarte con ellos a través del interfaz de 16 pines.
Este sketch de ejemplo muestra el uso de los métodos cursor() y noCursor() para controlar el cursor en forma de guión bajo.
Examples > Libraries > LiquidCrystal
Ejemplos > Librarias > LiquidCrystal
/* LiquidCrystal Library - Cursor Demonstrates the use a 16x2 LCD display. The LiquidCrystal library 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 sketch prints "Hello World!" to the LCD and uses the cursor() and noCursor() methods to turn on and off the cursor. 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 * 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 25 July 2009 by David A. Mellis
http://www.arduino.cc/en/Tutorial/LiquidCrystal */
// 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 rows and columns: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); }
void loop() { // Turn off the cursor: lcd.noCursor(); delay(500); // Turn on the cursor: lcd.cursor(); delay(500); }
(:includeurl http://arduino.googlecode.com/svn/trunk/libraries/LiquidCrystal/examples/Cursor/Cursor.pde border=0:)
modified 25 July 2009 by David A. Mellis
lcd.begin(2, 16);
lcd.begin(16, 2);
// Turn off the display:
lcd.noCursor();
// Turn off the cursor: lcd.noCursor();
// Turn on the display:
lcd.cursor();
// Turn on the cursor: lcd.cursor();
LiquidCrystal Library - setCursor
LiquidCrystal Library - Cursor
This sketch prints to all the positions of the LCD using the setCursor(0 method:
This sketch prints "Hello World!" to the LCD and uses the cursor() and noCursor() methods to turn on and off the cursor.
The circuit:
The circuit:
#include <LiquidCrystal.h>
#include <LiquidCrystal.h>
// these constants won't change. But you can change the size of // your LCD using them: const int numRows = 2; const int numCols = 16;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
lcd.begin(numRows, numCols);
lcd.begin(2, 16); // Print a message to the LCD. lcd.print("hello, world!");
// loop from ASCII 'a' to ASCII 'z': for (int thisLetter = 'a'; thisLetter <= 'z'; thisLetter++) { // loop over the columns: for (int thisCol = 0; thisCol < numRows; thisCol++) { // loop over the rows: for (int thisRow = 0; thisRow < numCols; thisRow++) { // set the cursor position: lcd.setCursor(thisRow,thisCol); // print the letter: lcd.print(thisLetter, BYTE); delay(200); } } }
// Turn off the display: lcd.noCursor(); delay(500); // Turn on the display: lcd.cursor(); delay(500);
LiquidCrystal Library - Cursor
LiquidCrystal Library - setCursor
This sketch prints "Hello World!" to the LCD and uses the cursor() and noCursor() methods to turn on and off the cursor.
This sketch prints to all the positions of the LCD using the setCursor(0 method:
The circuit:
The circuit:
* LCD R/W pin to digital pin 11 * LCD Enable pin to digital pin 10
* LCD Enable pin to digital pin 11
by Limor Fried example added 7 Jul 2009
by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009
// these constants won't change. But you can change the size of // your LCD using them: const int numRows = 2; const int numCols = 16;
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// set up the LCD's number of columns and rows: lcd.begin(2, 16); // Print a message to the LCD. lcd.print("hello, world!");
// set up the LCD's number of rows and columns: lcd.begin(numRows, numCols);
// Turn off the display: lcd.noCursor(); delay(500); // Turn on the display: lcd.cursor(); delay(500);
// loop from ASCII 'a' to ASCII 'z': for (int thisLetter = 'a'; thisLetter <= 'z'; thisLetter++) { // loop over the columns: for (int thisCol = 0; thisCol < numRows; thisCol++) { // loop over the rows: for (int thisRow = 0; thisRow < numCols; thisRow++) { // set the cursor position: lcd.setCursor(thisRow,thisCol); // print the letter: lcd.print(thisLetter, BYTE); delay(200); } } }
Examples > Libraries > LiquidCrystal
The LiquidCrystal library allows you to control 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 example sketch shows how to use the cursor() and noCursor() methods to control an underscore-style cursor.
(:include LiquidCrystalCircuit :)
(:div class=code :)
/* LiquidCrystal Library - Cursor Demonstrates the use a 16x2 LCD display. The LiquidCrystal library 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 sketch prints "Hello World!" to the LCD and uses the cursor() and noCursor() methods to turn on and off the cursor. The circuit: * LCD RS pin to digital pin 12 * LCD R/W pin to digital pin 11 * LCD Enable pin to digital pin 10 * 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 * 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 example added 7 Jul 2009 by Tom Igoe http://www.arduino.cc/en/Tutorial/LiquidCrystal */
// include the library code: #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
void setup() { // set up the LCD's number of columns and rows: lcd.begin(2, 16); // Print a message to the LCD. lcd.print("hello, world!"); }
void loop() { // Turn off the display: lcd.noCursor(); delay(500); // Turn on the display: lcd.cursor(); delay(500); }
(:divend:)