- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems extremely trivial but I'm trying to convert a float
to the char []
so I can print it out in UART. Here is how I'm trying to achieve this:
char buff[10];
float test = 2.32
sprintf(buff, "%f", test);
UART_UartPutString(buff);
However doing this nothing is printing out...The above is what i've seen on all the examples :,( why isn't this working for me.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I stated in another of your threads: To use sprintf for floats you need to set
Use newlib nano
Use newlib nano float formatting
Heap size 0x0200
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I stated in another of your threads: To use sprintf for floats you need to set
Use newlib nano
Use newlib nano float formatting
Heap size 0x0200
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're right, I apologize. I'm so in over my head trying to get this project to work I miss some things.
Does the heap size have to be that exactly? Or at least 0x0200?
side note: I deeply deeply appreciate all you're help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did not take the time to find out the minimum value, but 0x0200 seem to be large enough for heap.
Bob