Help with Scrolling Text

When using the LCD 1602 module, I would like to scroll text only in the second row, but it currently scrolls text in both rows.

void checkFingerData(int userid, int confidence) {
  if (!regMode) {
    Serial.print(String(confidence));
    if (confidence > 60) {
      lcd.clear();
      centerText(0, "Welcome");

      lcd.setCursor(0, 1);
      lcd.print("This is test scrolling 2nd row");

     
      int textLength = 20; 
      for (int positionCounter = 0; positionCounter < textLength; positionCounter++) {
        lcd.scrollDisplayLeft();
        delay(300);
      }

      for (int positionCounter = 0; positionCounter < textLength; positionCounter++) {
        lcd.scrollDisplayRight();
        delay(300);
      }

      delay(1000);
      lcd.clear();
      getTime();
      delay(1000);
      lcd.clear();
      centerText(0, "Message");
      centerText(1, "Sent");
      sendSMS("User " + String(userid) + " entered the classroom", currentTime, currentDate);
      delay(1000);
      lcd.clear();
      centerText(0, "Fingerprint");
      lcd.setCursor(0, 1);
      lcd.print(F("Attendance System"));
    }
  }
}

Please post your full sketch

why it has 600 lines?

Why ?

So that your question can be seen in context of your whole sketch

why would you need the whole sketch? I just want to scroll the text of 2nd row not both

The function scrollDisplayLeft(), according to its name, do scrolling of the entire display.

how would I only display the 2nd row?

There is not a single line in your code that would cause scrolling of only one line. Why do you expect only the second line to move? Where is this in the code? And why exactly the second, and not the first or, for example, the fourth???

It is very common for problems posted here are caused by code not in the snippet posted. That may not be the case with your code but seeing the whole sketch can be helpful

Why not make it easier to provide help and post a smaller but complete sketch that illustrates the problem ?

because it has more characters than "Welcome"? I want to make the text of the 2nd row all visible. and the Welcome will stay put I don't know if this is possible

If English is not your native language, please use a translator, I don’t understand well what you write.
I don't understand, how the length of lines related to the scrolling.

I asked you, where you defined in your code that you want to scroll only second line. I don't see anything similar in the code.

The LCD screen I'm using has a limitation in its display capacity, allowing only up to 16 characters to be shown at any given time. This means when I attempt to display more than 16 characters, the excess characters are not visible on the screen. This limitation poses a challenge, especially when I need to display critical information that exceeds the 16-character limit. So I want to use the scroll function.

Ok, I understood why do you need to scroll.

But I still not understand, why you expected that your code will scroll only the second line. You done nothing for it.

You would scroll the single line manually - print the line, wait the some milliseconds, then clean the line and redraw it at the new position. And so on

Can you give me an example?

What the example do you need to print the text? delete it and print again?

Post your original sketch, or a minimal, compilable sketch showing the problem.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.