Scroll Portion of 16 X 2

Would like to scroll left to right only the plain text in rows 1 & 2 while the custom characters (CHS) remain in place. Any suggestions?

HS_Letters_Partial_Scroll.ino (2.17 KB)

Partial Scroll Screenshot.PNG

Partial Scroll Screenshot.PNG

Yes, it's quite simple.

You have your text stored in an array. You set the cursor to the first location of your scroll area on the display, then you index to the variable point in the array which corresponds to the first character that you need to place in that scroll area and write as many characters as will fit in that scroll area, over-writing the characters previously there. To "loop" the scroll, you need to constrain the index into the array so it stays in the array each time you pick up another character to write.

You do the same thing for each line; you can choose whether to do so at the same rate or not.

One thing you do not do is to clear the display. :roll_eyes:


I did not look at your code as you did not post it according to the forum instructions (point 7) at the top of the section. :roll_eyes:

Thanks for your reply. Sorry posting incorrectly. Per your suggestion, my coding skills are limited, but here's my code:

#include  <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //my lcd pin setup, change it to yours
int backLight = 43;

int f=4;                  //set frames per second (fps)
int s;

// the following frams of the 8-bit Mario are made from a orginal 8-bit Mario as reference
// left number is the frame right number is the position (mario xy)
// (1 = top left 2 = bottem left 3 = top right 4 = bottem right)


//top row left margin 
byte letter1t[8] = {

B11110,
  B11110,
  B11110,
  B10000,
  B10000,
  B10000,
  B10000,
  B10000
};

byte letter1b[8] = {

B10000,
  B10000,
  B10000,
  B10000,
  B10000,
  B11110,
  B11110,
  B11110
};


byte letter2t[8] = {
B10001,
  B10001,
  B10001,
  B10001,
  B10001,
  B10001,
  B10001,
  B11111
};

byte letter2b[8] = {
B11111,
  B10001,
  B10001,
  B10001,
  B10001,
  B10001,
  B10001,
  B10001
};

byte letter3t[8] = {
B01111,
  B01111,
  B01111,
  B01000,
  B01000,
  B01000,
  B01000,
  B01111
  
};

byte letter3b[8] = {
B01111,
  B00001,
  B00001,
  B00001,
  B00001,
  B01111,
  B01111,
  B01111
};

void setup() {
lcd.begin(16,2);
pinMode(backLight, OUTPUT);
digitalWrite(backLight, HIGH);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.createChar(1, letter1t);       //First letter, top half
lcd.createChar(2, letter1b);
lcd.createChar(3, letter2t);
lcd.createChar(4, letter2b);
lcd.createChar(5, letter3t);
lcd.createChar(6, letter3b);

lcd.setCursor(0,0);
lcd.write(1);
lcd.setCursor(0,1);
lcd.write(2);
lcd.setCursor(1,0);
lcd.write(3);
lcd.setCursor(1,1);
lcd.write(4);
lcd.setCursor(2,0);
lcd.write(5);
lcd.setCursor(2,2);
lcd.write(6);
  
delay(750);

// Print a message to the LCD.
lcd.setCursor(4,0);
lcd.print("Class of 2022");
// sets the cursor to the second line
  delay(450);
lcd.setCursor(4,4);
lcd.print("Go Warriors!");


}

void loop() {
 // scroll 45 positions (string length) to the left
// to move it offscreen left:
//for (int positionCounter = 0; positionCounter < 45; positionCounter++) {
// scroll three positions left:
//for (int n = 0; n<3; n++) {
//lcd.scrollDisplayLeft();
}