Display long text on 16 x 2 display

Hello,
I use the library LiquidCrystal_I2C.h but I don't have the possibility to show a long text. If my text is up to 40 charter, this is cutting on two part. The 41 charter and after is showing on the second line.

#include <LiquidCrystal_I2C.h>
#include <Keypad_I2C.h>


const byte keypadRow = 4;
const byte keypadCol = 4;

byte rowPins[keypadRow] = {0,1,2,3}; // Row 0,1,2,3
byte colPins[keypadCol] = {4,5,6,7}; // Col 0,1,2,3

int keypadArdesse = 0x22; // A0 and A2 GND and A1 5V

char keys[keypadRow][keypadCol] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

const byte lcdRow = 2;
const byte lcdCols = 16;

int lcdAdresse = 0x27;    // Default adress

Keypad_I2C keypad = Keypad_I2C(makeKeymap(keys), rowPins, colPins, keypadRow, keypadCol, keypadArdesse);
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(lcdAdresse,lcdCols,lcdRow);

bool backlight = true;

char txtFirstLine[] = "An den exis ti na kanis ela na pame mia megali volta opou 8elis ";

void setup(){
  Serial.begin(9600);
  keypad.begin();
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.printstr(txtFirstLine);
}

void loop(){
  char key = keypad.getKey();
  if(key){
    Serial.println(key);
    if(key == 'A')
      lcd.scrollDisplayLeft();
    if(key == 'B')
      lcd.scrollDisplayRight();
  }

Your code suggests you have a 2x16 display. Where do you think the 17th-40 characters are displayed?

How about scrolling the long text across one line ?

This how my screen show

https://s30.postimg.org/xcqi54tpd/IMG_1479.jpg

And yes the text scrolling

And yes the text scrolling

Off you go then ...

No because my string is writing in two line :slightly_frowning_face:

spyrto:
No because my string is writing in two line :slightly_frowning_face:

It is at the moment, but you have the option to scroll it across on one line if you like. You could even scroll it on two lines but that is more complicated and also more difficult to read.

I test multiple way to solve this but I have always same problem :frowning:

The test is everything
line 1 : An den exis ti na kanis ela na pame mia
line 2 : megali volta opou 8elis

Even with this function

void setup(){
  Serial.begin(9600);
  keypad.begin();
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.autoscroll();
}

void loop(){
//...
  lcd.setCursor(16,0);
  showTxt();
//...
}


void showTxt(){
  for (int i = 0; i < sizeof(txtFirstLine); ++i) {
    Serial.print(txtFirstLine[i]);
    delay(300);
    lcd.print(txtFirstLine[i]); 
  }
}

I think this is due to a memory overflow.

http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html