Arduino Function: LiquidCrystal.autoscroll

Description

Turns on automatic scrolling of the LCD. This causes each character output to the display to push previous characters over by one space. If the current text direction is left-to-right (the default), the display scrolls to the left; if the current direction is right-to-left, the display scrolls to the right. This has the effect of outputting each new character to the same location on the LCD.

Syntax

lcd.autoscroll()

Parameters

lcd: a variable of type LiquidCrystal

Examples

// 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);
char term[]={'A','r','d','u','i','n','o'};//create a character Array
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}

void loop() {
// set the cursor to (0,0):
lcd.setCursor(0, 0);
// print Arduino:
for (int i = 0; i < 7; i++){
lcd.print(term[i]);
delay(500);
}

// set the cursor to (16,1):
lcd.setCursor(16, 1);
// set the display to automatically scroll:
lcd.autoscroll();
// print Arduino:
for (int i = 0; i < 7; i++){
lcd.print(term[i]);
delay(500);
}
// turn off automatic scrolling
lcd.noAutoscroll();
// clear screen for the next loop:
lcd.clear();
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc