LCD 1602A constinues scrolling to second line

Hi.
My son and I are playing with an Arduino Uno since short and when trying to generate a scroll function for a 1602 LCD, the message constinues scrolling left, and then it goes to the second line (#1). We know that a scrolling function already exists, but we were trying to make a one on our own.

The code is very simple:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12,11,5,4,3,2);
byte numcol;

void setup() {
lcd.begin(16,2);
lcd.setCursor(0,0);
}

void loop() {
for(numcol = 15; numcol >= 0; numcol–){
lcd.setCursor(numcol,0);
lcd.print ("We dit it!! "); // space added at the end, so not traillign character being seen
delay(250);
}
}

What we obtain is the message starting on position (15,0), which is normal. Then the start of the sentense raches (0,0), Thne it stops and continues scrolling left until the last character (space) reaches (0,0). Then the message is shown again aligned on (0,0), and it scrolls again left to the end.
And then the most puzzling thing: message starts scrolling from (15,1) and it does the same as in line “0”.

We have tried adding lcd.clear() inside the For, inside loop(), but nothing changes.

We have also realized that if we stop the For loop with “numcol>=1”, the mssags scrols as expected till column 1 and the loop restarts normally. The problem is when column “0” is reached.

Why does it continues scrolling once (0,0) is reached?

Why does it continue scrolling on line “1”, even if the lcd.setCursor only states line “0”?

I gues this should be some kind of built-in function of the lcd controller and that by any reason the message builds up in size (even if we have put lcd.clear() inside the For loop) and the lcd tries to show it complete.

How can this behavior be avoided?

Thanks to all.

[color=red]byte[/color] numcol;
...
for(numcol = 15; numcol [color=red]>= 0[/color]; numcol--){

suggest you double check if a byte can actually be anything else than >= 0 :)

J-M-L: [color=red]byte[/color] numcol; ... for(numcol = 15; numcol [color=red]>= 0[/color]; numcol--){

suggest you double check if a byte can actually be anything else than >= 0 :)

That is a perfect illustration of why separating the variable declaration from the for loop is a bad idea. Too easy to miss the incorrect type.