karokh
December 21, 2022, 5:26pm
1
Here is a way to scroll a text on LCD screen:
// C++ code
#include <Adafruit_LiquidCrystal.h>
String text="Hello & Karokh";
Adafruit_LiquidCrystal lcd_1(0);
void setup(){
lcd_1.begin(16, 2);
}
void loop()
{
for(int i=0;i<16;i++){
lcd_1.clear();
lcd_1.setCursor(i, 0);
lcd_1.print(text);
if(i+text.length()>16){
int y = i+text.length()-16;
int row=0;
for(int j=text.length()-y;j<text.length();j++){
lcd_1.setCursor(row, 0);
row++;
lcd_1.print(text[j]);
}
}
delay(200);
}
}
Welcome to the forum
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
See also FAQ - Arduino Forum for general rules on forum behaviour and etiquette.
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is fru…
1 Like
Hi,
If you have any difficulties with your project,
explain the difficulty.
Inform which arduino you are using.
Post a schematic of your project. It can be done freehand.
system
Closed
June 20, 2023, 9:10pm
4
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.