2022-04-03 02:23 AM
Hello everybody,
i create a project using TouchGFX 4.18 to read temperature.
When a button is pressed i create a routine that read temperature from a sensor and show this in a text area inside a container.
In TouchGFX i create a wildcard in texarea with buffer size 10 and default value 25.0
Here below the code...about the View.cpp
void MainView::toggle_singleReadButtonPressed()
{
float temp=0.0;
mysensor_Read_Data_Sensor(&temp); //routine that read temperature
textArea_WC_TEMP.setWildcard(textArea_WC_TEMPBuffer);
// add(textArea_WC_TEMP); //commented not function correctly
if (temp >0.0)
{ Unicode::snprintfFloat(textArea_WC_TEMPBuffer, 10, "%+4.2f", temp);
}
else
{ Unicode::snprintfFloat(textArea_WC_TEMPBuffer, 10, "%-4.2f", temp);
}
textArea_WC_TEMP.invalidate();
}
the textArea_WC_TEMP object is create in tha MainViewBase class created by TouchGFX and i see it inside the file .hpp.
I follow the example in tutorial :
But the add function create the effect the the micro goes in hang...
so remove it but i see strange chars on the screen..
I check the buffer filled with snprintfFloat and it is correct..
Why appear ? characters on the screen???
There aren't these chars in the buffer... i attach the image
What happen?
Someone have the some problem?
Thanks
Enal
2022-04-03 03:04 AM
Beginers repeat this error ... your font dont have all characters , but only used or defined, all other is showed as ? default.
Add to font 0..9 or any chars you plan use from code.
2022-04-18 07:28 AM
Hi MM..1,
I add a text area.. so i usually expect to fill the text area with every chars available on the keyboard..
But i read that is not so.. it's strange.
I update the char field follow your advice and now it is correct!
Anyway thanks
Bye
Enal