Code for displaying data on a tft touch screen.

Hi all,

Very new to Arduino so, can anyone tell me what the code is for displaying data from a temp sensor on my touch screen? I have gotten as far as displaying letters, numbers and colors on it but get stumped when it comes to displaying data read from a sensor.
I tried using myGLCD.print(analog_pin, CENTER, 120) but get char conversion errors. Any suggestions?

Thanks for your help in advance!

Brian

It is an analog sensor ?
Connected to an analog pin ?
Can you print the temperature to the serial monitor ?

Try a few things:

int temp1=35;
myGLCD.print(temp1, CENTER, 120);
float temp2 = 56.2;
myGLCD.print(temp2, CENTER, 120);

When you have the temperature value valid on the serial monitor, and printing a value is working, you can print the temperature on the LCD.

I assume that you are using the UTFT Library...

You may care to have a read of the manual available here Electronics - Henning Karlsen

Specifically, you might like to have a look at the difference between print, printNumI and printNumF.

Cheers