how to print a variable in a 16,2 lcd?

zacmackra:
hey guys i have read the temperature from my temp sensor which i want to print on lcd like this:

temperature= xx
(text) (variable)

how to do it?
sould be in the same line

Do the "temprature=" at 0,0 in setup
In the loop, set cusor to 12
lcd.print(variable);

just like Serial.print(variable), which I assume you have already done.

There are refinements. You may be better off print "temp=" and cursor 11, to allow for two digit floats with minis sign. You may also need to follow positives with a blank space, or arrange a cursor 12 for them.

1 Like