3

I have tried several different ways to do this, but in the line:

myTFT.println("DS32(32,g,'Hello!',4);");

where g is an int, it simply doesn't print. If I just replace the g with a value of any kind, all is well.

I'm using an Uno (well, an Orion board from Makeblock) and the Makeblock TFT.

All my other print lines work fine but of course, none contain variables.

1

Just split the print into three parts:

myTFT.print("DS32(32,");
myTFT.print(g);
myTFT.println(",'Hello!',4);");
  • My problem was that I didn't stop to think that the entire line being passed was a string. As soon as that dawned on me, I changed the int to a string and split it just as you showed. Worked perfect. THANK YOU! – Big Al Aug 27 '16 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.