Need Help With Seed Studio TFT 1.0

I have had a 2.8" TFT from Seed Studio laying around and finally found a use for it, however I ran into an issue and was curious if I could get help. This is the Wiki page : http://www.seeedstudio.com/wiki/TFT_Touch_Shield_V1.0

The TFT comes with two draw functions, drawChar, and drawString. In my code I have a 50k thermistor wired to analog pin 15 and have it outputting the temperature in the serial port. This temp value however is as an int. I was curious if it was possible to convert this int into a string, or do anything at all really to output this value to the TFT so that it displays the temp value.

This temp value however is as an int. I was curious if it was possible to convert this int into a string

That’s why sprintf() was developed.

Or, if you don’t need the formatting that sprintf() offers, use itoa().

PaulS: That's why sprintf() was developed.

Or, if you don't need the formatting that sprintf() offers, use itoa().

I'm unsure how to use sprintf() in this case. The TFT library only seems to allow me to output to the screen using Tft.drawString("___", x, y, font size, color)

jmi0920:
I’m unsure how to use sprintf() in this case. The TFT library only seems to allow me to output to the screen using Tft.drawString("___", x, y, font size, color)

And how are you going to create a string from your integer?

I'm unsure how to use sprintf() in this case.

char yoDumbAssThisIsAString[20];

int temperature = hotterThanHell;

sprintf(yoDumbAssThisIsAString, "%d", temperature);


Tft.drawString(yoDumbAssThisIsAString, here, there, reallyBig, neonPink);

PaulS: ``` char yoDumbAssThisIsAString[20];

int temperature = hotterThanHell;

sprintf(yoDumbAssThisIsAString, "%d", temperature);

Tft.drawString(yoDumbAssThisIsAString, here, there, reallyBig, neonPink);

I'll admit I'm still very new to this stuff, but that example was perfect, working great now. Thank you

jmi0920: I'll admit I'm still very new to this stuff, but that example was perfect, working great now. Thank you

Now you understand it, you can even change the names of the variables :)