cancel
Showing results for 
Search instead for 
Did you mean: 

How to write decimal figures to TouchGFX Text Box

DElli.1
Associate III

Hello!

Sorry I am new to stm32 and TouchGfx.

I am currently reading from SPI and want to relay that data to the screen using:

Unicode::snprintf(textCounterBuffer, 10, "%d", finalData);

textCounter.invalidate();

my problem is that the finalData is a decimal figure and the decimal gets cut off.

When I try to display the raw data number from my spi it displays fine and is a uint8_t variable. I need to adjust this number using:

finalData = (spiRxBuf/4096)*100;

but as I said before the screen does not display the number properly.

10 REPLIES 10

Sorry, I thought I said but I guess it was unclear.

When I use the regular snprintf like that it works fine and I get a number displayed on the screen.