Advertisement
Sierra_ONE

SCROLLING LCD TEXT

Apr 10th, 2023
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Arduino 0.60 KB | Source Code | 0 0
  1. void UpdateLCDDisplay() {
  2.   int iLenofLargeText = strlen (LargeText);
  3.   if (iCursor==(iLenofLargeText - 1))
  4.   {
  5.     iCursor = 0;
  6.   }
  7.   lcd.setCursor (0, iLineNumber);
  8.   if (iCursor < iLenofLargeText -16) {
  9.     for (int iChar = iCursor; iChar < iCursor + 16; iChar++)
  10.     {
  11.       lcd.print(LargeText[iChar]);
  12.     }
  13.   }
  14.   else
  15.   {
  16.     for (int iChar = iCursor; iChar < (iLenofLargeText - 1); iChar++)
  17.     {
  18.       lcd.print (LargeText[iChar]);
  19.     }
  20.     for (int iChar = 0; iChar <= 16 - (iLenofLargeText - iCursor); iChar++)
  21.     {
  22.       lcd.print (LargeText[iChar]);
  23.     }
  24.   }
  25.   iCursor++;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement