Hi There! I want to scroll the text on the LCD. I am using the below sketch but its giving error "cannot convert 'String' to 'char*' for argument '1' to 'void marquee(char*)". What I have to do to get this worked?
Thanks.
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int numRows = 2;
const int numCols = 16;
String stringOne;
String stringTwo;
String stringThree;
void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(numCols, numRows);
}
void loop()
{
stringOne = "HELLO WORLD!!";
stringTwo = "hello world!!";
stringThree = stringOne + stringTwo;
marquee(stringThree);
delay(1000);
lcd.clear();
}
// this function uses scrolling to display a message up to 32 bytes long
void marquee(char *text )
{
int length = strlen(text); // the number of characters in the text
if(length < numCols)
lcd.print(text);
else
{
int pos;
for( pos = 0; pos < numCols; pos++)
lcd.print(text[pos]);
delay(1000); // allow time to read the first line before scrolling
while(pos < length)
{
lcd.scrollDisplayLeft();
lcd.print(text[pos]);
pos = pos + 1;
delay(300);
}
}
}