This is not working anymore with strcpy():
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 13, 8, 9, 5, 11);
int x;
int y;
char myMsg[128];
void setup() {
Serial.begin(9600);
delay(500);
lcd.begin(16, 2);
lcd.print("Bienvenue");
delay(2000);
}
void loop() {
strcpy(myMsg, "message message message message message");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("TEST: ");
scroll(myMsg,1);
delay(1000);
}
void scroll(char msg[], int pos){
for (x = 0; x < strlen(msg) - 1; x++){
if (msg[x + y - 1] == '\0') break;
for (y = 0; y < 16; y++){
if (msg[x + y - 1] == '\0') break;
lcd.setCursor(y,pos);
lcd.print(msg[x+y]);
}
if (x == 0) {delay(1000);}
delay(200);
}
delay(1000);
}
The LCD screen doesn't write anything on the second line.