- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I need to use sprintf function with float numbers. But it does not work.
val=1.2243;
sprintf(text,"Value=%f",(float)val);LCD_Position(0u,0u);
LCD_PrintString(text);
Is there a setting in this regard?
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To get sprintf() running you need to
#include <stdio.h>
Set "use newlib nano"
Set "Use newlib nano float formatting" in Build Settings -> Linker
And increase heap size to 0x0200 in system view.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To get sprintf() running you need to
#include <stdio.h>
Set "use newlib nano"
Set "Use newlib nano float formatting" in Build Settings -> Linker
And increase heap size to 0x0200 in system view.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not able to find how to add:
"Use newlib nano float formatting" in Build Settings -> Linker
or how to change heap size to 0x200.
I'm using DAVE v4 so perhaps the UI for the options has changed. Oddly, sprintf with float was working, then mysteriously stopped. I'm suspecting heap, but can't seem to figure out how to change that with project properties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob,
I'm Fixed it