I have been working on a project where I need to convert an int8_t variable to a string. I did a bit of reading on this and came to a conclusion that using Strint(int8_t) is an option.
Here is my code:
int8_t matt = 0;
matt += 1;
char string[3]=String(matt);
tft.textWrite(string);// this is used to display text on an lcd display (arduino)
For some reason the method I used did not work so I researched a bit more and found out String(matt) is actually a String object. I don't really know if this is true for a fact. In order for the tft.textWrite(); to work it should look something like this.
Here is the code:
char string[15]= "Hello, World! ";
tft.textWrite(string);
I tried using this also:
char string[3];
sprintf(string, "%ld", matt);
However this did not work.
Can anybody help?
Thanks