Printing Float on LCD PSOC 4.2 and ARM GCC 5.4 COMPİLER

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi everone!

I have same problem as a lot of body but every solves are for old program (such as ARM GCC 4.7)

float ex1 = 1.232;

int ex2= 123;

char exchar[30];

sprintf(exchar,"Testing: %f",ex1);

this printing on LCD Testing:

but

sprintf(exchar,"Testing: %d",ex2);

this printing on LCD  Testing: 123

How can I fix this

0 Likes
1 Solution
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Please check this KBA:

Floating-Point Support for PRINTF and SCANF in GNU Arm Compiler - KBA89724

Make sure that the heap size required to support sprintf and sscanf is set in your project (.cydwr > System > Heap Size). The default value is 0x80, which will not be enough to support these functions. You can change it to a higher value such as 0x1000.

View solution in original post

0 Likes
4 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Please check this KBA:

Floating-Point Support for PRINTF and SCANF in GNU Arm Compiler - KBA89724

Make sure that the heap size required to support sprintf and sscanf is set in your project (.cydwr > System > Heap Size). The default value is 0x80, which will not be enough to support these functions. You can change it to a higher value such as 0x1000.

0 Likes
Anonymous
Not applicable

thank you so much

but what is the .cydwr? ,  Where can i find it?

0 Likes

Here you can find it->pastedImage_0.png

0 Likes
Anonymous
Not applicable

Oh! Thank you so much man

I'm thankfull to you it is worked So i made my project %30 because of you ❤️

0 Likes