Need help with LCD Textscroll

Hello i need some help with LCD Textscroll in a 20x4 or 16x2 display

1:
After the first lcd line is full, my text jumps one line up (from line 4 to line 3)
at the same time line 2 (should be empty) is filled with a strange character.
After the next line jump uppwards, all is ok and the “strange characters” disapear,
cause they are overwritten.
Maybe thats a problem of the noname chinese display?

2:
The first line is always keeped empty, but i want to use that line too.
I cant figure out how to solve this problem.

Can someone please help me with this 2 problems?

Here is a well running code to experiment with it:

#include <LiquidCrystal.h> //bitbucket.org/fmalpartida/new-liquidcrystal/downloads/
LiquidCrystal lcd(13,12,11,10,8,7); //LCD-Connection (RS,E,D4,D5,D6,D7)
#define COLS 20 //16 or 20
#define ROWS  4 // 2 or  4

unsigned int COLpos=0, line1[COLS], line2[COLS];

void setup() {lcd.begin(COLS,ROWS); lcd.clear();}

void loop()
 {for(byte i=65; i<91; i++) //Letters A-Z
   {pntASCII(i);
    //Keep this 2 signs always on screen!
    if(ROWS==2) {lcd.setCursor(14,0); lcd.print("00");}
    if(ROWS==4) {lcd.setCursor(18,0); lcd.print("00");}
    delay(150);
   }
 }

void pntASCII(byte nr)
 {if(COLpos>COLS-1)
   {COLpos=0; //New line, next ROW
    if(ROWS==4)
     {for(byte i=0; i<=COLS-1; i++)
       {lcd.setCursor(i,ROWS-3);
        lcd.write(line2[i]);
        line2[i]=line1[i];
       }
     }
    for(byte i=0; i<=COLS-1; i++)
     {lcd.setCursor(i,ROWS-2);
      lcd.write(line1[i]);
      lcd.setCursor(i,ROWS-1);
      lcd.write(32);
     }
   }
  line1[COLpos]=nr;
  lcd.setCursor(COLpos,ROWS-1);
  lcd.write(nr);
  COLpos+=1;
 }

After your first line is full, you write out everything in your line2 array, but that array is empty (all 0's) since you have not put anything in it. After you write it out, you then replace the contents with what is in line1.

Maybe you should initialize line2 with spaces in setup()?

OnlySketching:
Maybe that's a problem of the noname Chinese display?

It is said that "A bad workman blames his tools" and this could not be more true here! :grinning:

You are expecting this display library to magically function like an old-fashioned VDU display. It is not intended to do so. If you want to muck about on multiple lines, you must provide the code to do so. :roll_eyes:

Bill's "HD44780" library which you would (only) install using the Library manager in the IDE, provides some of the functionality you want - it includes many explanations and examples.