Widget LCD variable + string

Widget on the LCD display as you write on the same line a variable + text string?

Written as a hardware lcd does not work then I tried on the same type of line, but I can not find examples and the syntax is not correct:

lcd.print(0,1, (tempcountdown); ?
lcd.print(0,1, “second”); ?

lcd.print(0,1, tempcountdown “second”); ?
lcd.print(0,1, tempcountdown . “second”); ?
lcd.print(0,1, (tempcountdown) “second”); ?
lcd.print(0,1, (tempcountdown).(“second”)); ?

thanks bye


As LCD requires a string, and as far as I know only a string, then you would need to convert the variable to a string and add your string text (prefix or suffix) to the string. Extract from our project:

String ThePrefix = " ";      
CurrentTime = ThePrefix + CountdownTime + " MINUTE(S)  ";  // needed to ensure string is correct
// row above converts integer time to a string and adds prefix and suffix to string
lcd.print(0, 1, CurrentTime);
1 Like

thanks Costas

ok … I got fooled because if I write:
lcd.print (0,1, tempcountdown);
it works ok!

then only the string variable without works perfectly! if you add the string not.

Costas thanks for your help, now I try your solution, hello