Problem with wildcard in textarea..
- April 3, 2022
- 2 replies
- 1357 views
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
