the WidgetLCD library lacks the scroll function.
how do I scroll a long text on a line?
by code
an example?
string txtMsg1="Hello how are you ? ";
string txtMsg;
//■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
//■ scrollLCD ■
//■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
void scrollLCD() {
timer.setInterval(150L, LcdPrint); // move every 150 ms
}
void LcdPrint() {
txtMsg = " " + txtMsg1 + " ";
int txtLng = txtMsg.length() - 15;
Serial.println(txtLng);
if (PositionCount >= txtMsg.length() - 15) {
PositionCount = 0;
Serial.println("fin ");
lcd.clear();
} else {
stringOne = txtMsg.substring(PositionCount, PositionCount + 16);
Serial.println(stringOne);
Serial.println(PositionCount);
lcd.print(0, 0, stringOne);
PositionCount = PositionCount + 1;
}
}
2 Likes
thank you
1 Like