thank you very much for the great library!
I got two small questions.
First I have problems using the function TFT_clearStringRect.
If I just enter the X- and Y-values of a string, then it is not erased correctly.
I have to use the Y-value minus fontHeight -3 to fix this.
I guess I make something wrong.
How do I use this function properly?
The second question is, how can I display the degree symbol °.
This I also tried in the example below.
Thank you very much
Code: Select all
void printData(void *pvParameter)
{
font_transparent = 1;
_bg = TFT_BLACK;
_fg= TFT_WHITE;
TFT_fillScreen(_bg);
TFT_setFont(DEJAVU18_FONT, NULL);
int xPosTempStr = 50;
int yPosTempStr = 100;
int fontHeight = TFT_getfontheight();
while(1) {
float temperature = 25.00;
char temperature_str[100];
sprintf(temperature_str, "Temp.: %.1f %cC",temperature, (char)248);
TFT_clearStringRect(xPosTempStr, yPosTempStr - fontHeight - 3, temperature_str);
TFT_print(temperature_str, xPosTempStr, yPosTempStr);
vTaskDelay(5000 / portTICK_RATE_MS);
}
}