newb question on lcd.print - (SOLVED)

sorry for being a newb.. but how do you print text AND a variable?

lcd.print("hello:") && (Name); // Name is a variable, but this doesn't work

lcd.print("hello:" + Name); // doesn't work

lcd.print("hello:" + (Name); // doesn't work

lcd.print("hello:" + (Name)); // doesn't work

i just want it to say: hello: whatever value Name is

Try this.

lcd.print("hello: "); // could be in setup() if permanently there
setCursor(0, 7); // move cursor to first line, eight position
lcd.print(Name);

Leo..

i don't know why i didn't even think of trying that lol.. i just automatically assumed it could be done in 1 line of code :confused:

thank you

Karma pt added :slight_smile:

setCursor(0, 7); // move cursor to first line, eight position

Do we need to execute this line?

The cursor should automatically move to the next position as the character is printed?

i'll try with and without tomorrow.. i'm off to bed

GolamMostafa:
Do we need to execute this line?
The cursor should automatically move to the next position as the character is printed?

Only needed if "hello: " is in setup().
Added, so OP understands that you can change/print anywhere on the LCD.
Leo..

even in setup() it doesn't need it..

anyways, it's all worked out.. thank you

Unless you write more than only that "hello: " line in setup().
The cursor just stays were you have left it.

With setCursor(); you can also overwrite the first name, without affecting "hello: "
Leo..