ILI9341_t3n is there a simple way to print an integer?

clinker8

Well-known member
I found the drawFloat function which is handy. However, I'd like to pass an integer to a similar function to get text in the center of the box. drawString means I need to convert the int to string. Haven't found an easy way to do that. Sorry it is such a simple question, but my C skills are weak.

drawFloat with dp=0 adds a 0 after the decimal point. I don't have room on the display for that. I wasn't expecting that dp=0 and dp=1 give the same result.

tft.drawFloat((float) newustep, 0, x+w/2, y+h/2); outputs 8.0, thought I would get 8. Really would like to get just 8, as newustep is just an integer. Actually, ustep, N and D are integers. Can someone kindly point me in the right direction? A minimal example would be helpful. Thanks.
PXL_20220530_175915228a.jpg
 
Well color me embarrassed. drawNumber works just grand. Can't believe I didn't see that before. Sorry for the noise. Slowly this interface ekes along...
PXL_20220530_182859290a.jpg
 
Back
Top