Tutorial.LiquidCrystalScroll History

Hide minor edits - Show changes to markup

April 09, 2013, at 06:06 PM by Federico -
Added line 13:
  • pin headers to solder to the LCD display pins
Added line 22:

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above.\\

Deleted line 68:
December 10, 2012, at 04:15 PM by Scott Fitzgerald -
Changed line 21 from:

To wire your LED screen to your Arduino, connect the following pins:

to:

To wire your LCD screen to your Arduino, connect the following pins:

November 16, 2011, at 04:37 AM by Scott Fitzgerald -
Changed lines 43-44 from:
to:
September 23, 2010, at 10:49 PM by Christian Cerrito -
Changed lines 3-4 from:

LiquidCrystal - scrollDisplayLeft() and scrollDisplayRight()

to:

LiquidCrystal - scrollDisplayLeft() and scrollDisplayRight()

September 21, 2010, at 11:02 PM by Christian Cerrito -
September 21, 2010, at 11:02 PM by Christian Cerrito -
Changed lines 5-6 from:

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.

to:

The Liquid Crystal 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.

Added lines 50-55:
Deleted line 59:
  • Scroll: scroll text left and right.
Added lines 66-67:
September 21, 2010, at 09:01 AM by Christian Cerrito -
Changed line 30 from:

Additionally, wire a 10K pot to +5V and GND, with it's wiper (output) to LCD screens VO pin (pin3).

to:

Additionally, wire a 10K pot to +5V and GND, with it's wiper (output) to LCD screen's VO pin (pin3).

Added lines 58-60:

September 21, 2010, at 09:00 AM by Christian Cerrito -
Changed lines 9-10 from:
to:
Changed lines 45-57 from:
to:
February 09, 2010, at 12:36 AM by Tom Igoe -
Changed lines 13-95 from:
 /*
   LiquidCrystal Library - scrollDisplayLeft() and scrollDisplayRight()
  
  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
  scrollDisplayLeft() and scrollDisplayRight() methods to scroll
  the text.
  
   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);
   //lcd.setCursor(0,7);
   // Print a message to the LCD.
   lcd.print("hello, world!");
   delay(1000);
 }

 void loop() {
   // scroll 13 positions (string length) to the left 
   // to move it offscreen left:
   for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
     // scroll one position left:
     lcd.scrollDisplayLeft(); 
     // wait a bit:
     delay(150);
   }

   // scroll 29 positions (string length + display length) to the right
   // to move it offscreen right:
   for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
     // scroll one position right:
     lcd.scrollDisplayRight(); 
     // wait a bit:
     delay(150);
   }

     // scroll 16 positions (display length + string length) to the left
     // to move it back to center:
   for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
     // scroll one position left:
     lcd.scrollDisplayLeft(); 
     // wait a bit:
     delay(150);
   }

   // delay at the end of the full loop:
   delay(1000);

 }
to:
August 05, 2009, at 05:19 PM by Tom Igoe -
Changed lines 3-4 from:

LiquidCrystal - shiftLeft() and shiftRight()

to:

LiquidCrystal - scrollDisplayLeft() and scrollDisplayRight()

Changed lines 7-8 from:

This example sketch shows how to use the shiftLeft(0 and shiftRight() methods to reverse the direction the text is flowing. It starts writing letters left to right from a to m, then reverses direction until s, then reverses again until z.

to:

This example sketch shows how to use the scrollDisplayLeft() and scrollDisplayRight() methods to reverse the direction the text is flowing. It prints "Hello World!", scrolls it offscreen to the left, then offscreen to the right, then back to home.

Changed lines 14-15 from:
   /*
   LiquidCrystal Library - Shift
to:
 /*
   LiquidCrystal Library - scrollDisplayLeft() and scrollDisplayRight()
Changed lines 22-23 from:
  This sketch demonstrates how to use shiftLeft() and shiftRight()
  to move the cursor.
to:
  This sketch prints "Hello World!" to the LCD and uses the
  scrollDisplayLeft() and scrollDisplayRight() methods to scroll
  the text.
Changed line 26 from:
  The circuit:
to:
   The circuit:
Added lines 43-44:
  modified 25 July 2009
  by David A. Mellis
Deleted line 46:
  
Changed line 50 from:
 #include <LiquidCrystal.h>
to:
 #include <LiquidCrystal.h>
Changed line 53 from:
 LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
to:
 LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Deleted lines 54-55:
 int thisChar = 'a';
Changed lines 57-60 from:
   lcd.begin(2, 16);
   // turn on the cursor:
   lcd.cursor();
   Serial.begin(9600);
to:
   lcd.begin(16, 2);
   //lcd.setCursor(0,7);
   // Print a message to the LCD.
   lcd.print("hello, world!");
   delay(1000);
Changed lines 65-68 from:
   // reverse directions at 'm':
   if (thisChar == 'm') {
     // go right for the next letter
     lcd.shiftRight(); 
to:
   // scroll 13 positions (string length) to the left 
   // to move it offscreen left:
   for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
     // scroll one position left:
     lcd.scrollDisplayLeft(); 
     // wait a bit:
     delay(150);
Changed lines 73-76 from:
   // reverse again at 's':
   if (thisChar == 's') {
     // go left for the next letter
     lcd.shiftLeft(); 
to:
   // scroll 29 positions (string length + display length) to the right
   // to move it offscreen right:
   for (int positionCounter = 0; positionCounter < 29; positionCounter++) {
     // scroll one position right:
     lcd.scrollDisplayRight(); 
     // wait a bit:
     delay(150);
Changed lines 82-87 from:
   // reset at 'z':
   if (thisChar > 'z') {
     // go to (0,0):
     lcd.home(); 
     // start again at 0
     thisChar = 'a';
to:
     // scroll 16 positions (display length + string length) to the left
     // to move it back to center:
   for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
     // scroll one position left:
     lcd.scrollDisplayLeft(); 
     // wait a bit:
     delay(150);
Changed lines 91-93 from:
   // print the character
   lcd.print(thisChar, BYTE);
   // wait a second:
to:
   // delay at the end of the full loop:
Changed lines 94-95 from:
   // increment the letter:
   thisChar++;
to:
July 09, 2009, at 10:06 PM by Tom Igoe -
Changed line 14 from:
 /*
to:
   /*
Changed lines 27-28 from:
  * LCD R/W pin to digital pin 11
  * LCD Enable pin to digital pin 10
to:
  * LCD Enable pin to digital pin 11
Changed lines 39-40 from:
  by Limor Fried
  example added 7 Jul 2009
to:
  by Limor Fried (http://www.ladyada.net)
  example added 9 Jul 2009
Changed line 51 from:
 LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
to:
 LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Changed line 56 from:
   // set up the LCD's number of columns and rows: 
to:
   // set up the LCD's number of rows and columns: 
Deleted line 87:
July 08, 2009, at 10:16 PM by Tom Igoe -
Changed lines 1-2 from:
to:
July 08, 2009, at 10:14 PM by Tom Igoe -
Deleted line 2:
Added lines 36-37:
  
  */
Deleted lines 38-39:
  */
Added lines 45-46:
 int thisChar = 'a';
Added lines 50-52:
   // turn on the cursor:
   lcd.cursor();
   Serial.begin(9600);
Changed lines 56-59 from:
   // loop from ASCII 'a' to ASCII 'p' (16 letters):
   for (int thisLetter = 'a'; thisLetter < 'p'; thisLetter++) {
     // shift the cursor one position left:
to:
   // reverse directions at 'm':
   if (thisChar == 'm') {
     // go right for the next letter
     lcd.shiftRight(); 
   }
   // reverse again at 's':
   if (thisChar == 's') {
     // go left for the next letter
Deleted lines 64-67:
     // print the letter:
     lcd.print(thisLetter, BYTE);
     // delay a bit:
     delay(200);
Added lines 66-79:
   // reset at 'z':
   if (thisChar > 'z') {
     // go to (0,0):
     lcd.home(); 
     // start again at 0
     thisChar = 'a';
   }
   // print the character
   lcd.print(thisChar, BYTE);
   // wait a second:
   delay(1000);
   // increment the letter:
   thisChar++;
 }
Deleted lines 80-90:
   // loop from ASCII 'a' to ASCII 'p' (16 letters):
   for (int thisLetter = 'a'; thisLetter < 'p'; thisLetter++) {
     // shift the cursor one position right:
     lcd.shiftRight(); 
     // print the letter:
     lcd.print(thisLetter, BYTE);
     // delay a bit:
     delay(200);
   }
 }
July 08, 2009, at 09:02 PM by Tom Igoe -
Added lines 1-74:

Share