- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know there were discussions in the past related to sprintf, yet I cannot accomplish a simple task: to print on LCD a float using sprintf.
I use CY8CKIT-059 Kit and a Character LCD. The LCD displays everything but it fails to display a float number. For clarity I attach the bundle.
Is there something not right with stdio, or the sprintf... I ran out of ideas and the code looks so simple:
#include <project.h>
#include <stdio.h>
int main()
{
char str[16];
float Numb3r = 3.1416;
LCD_Start();
LCD_Position(0,0);
sprintf(str, "Pi = %1.4f...", Numb3r );
LCD_PrintString(str);
}
Is there a known bug, or anyone knows an workaround...
Thanks.
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, follow Michel's hints and set in system view the heap space to 200.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
For sure, it works for me.
Check your Build settings, I'm using these ones :
Michel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, follow Michel's hints and set in system view the heap space to 200.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It works as a charm, and the "Correct answer" should be shared with you too.
Thanks a lot to both user_2432504 AND user_1377889.
Regards.