OK OK OK, I have a 16x2 lcd setup on my Arduino duo, yahoo!!!
I am new to building electronics and the Arduino, yahoo!!!
I am playing with setting up the lcd and doing some basic things to get used to the the syntax.
While I was working on several things, I tried to set it up to scroll and almost have it working after several hours of syntax and logic research @ 2am I just don't get it. I don't see why it does not work.
The first line scrolls perfectly but the second line well gets all the way to the start of the string then pops back to the top row, otherwise does what I expect? Also there is probably a easier way to do this but one thing keeps leading to another

.
/*
The circuit:
* LCD RS pin to digital pin 7
* LCD Enable pin to digital pin 8
* LCD D4 pin to digital pin 9
* LCD D5 pin to digital pin 10
* LCD D6 pin to digital pin 11
* LCD D7 pin to digital pin 12
* LCD R/W pin to ground
* 10K resistor: ends to +5V and ground
* wiper to LCD VO pin (pin 3)
*/
// include the library code:
#include <LiquidCrystal.h>
// global variables
int columns = 16;
int rows = 2;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(columns, rows);
}
void loop() {
scroll("0123456789");
}
void scroll(String msg)
{
int x = 0;
int y = 0;
int x1 = 0;
String msg1;
for (y = 0; y <= rows; y++)
{
for (x = columns; x >= 0; x--)
{
lcd.setCursor(x, y);
if (x != 0)
{
lcd.print(msg);
delay(500);
lcd.clear();
} else
{
for (x1 = 0; x1 < msg.length(); x1++)
{
msg1 = msg.substring(x1);
lcd.print(msg1);
delay(500);
lcd.clear();
}
}
}
}
}
(code tags added by moderator)