I am a beginner using KL03 processor trying to learn with demo codes provided with KDS3.0.0 IDE.
when I am printing the float value like,
float a=2.4;
PRINTF("%f",a);
I am getting output as ' f ' only.
How to overcome with this floating problem.
Solved! Go to Solution.
Hi,
As a beginner I am just trying to understand the basic examples provided with the KDS 3.0.0 (with KL03 processor).
I was going through the "adc_lptmr_trigger" code. I just tried float value printing in this program but it is not printing, I followed the steps given by DavidS it was working good in hello_world example but not working here.
1. what should I do to get float value result?
2. Is there any way by which I can print float value in any code?
Hello,
The support of float numbers in printf can be enabled by using linker options. For example, when you create a new Kinetis Project in KDS 3.0.0 (with KSDK 1.3.0 and Processor Expert) you can find the option in the Properties of the project, see the following screenshot:
Please note that when this options is enabled the target code (memory footprint) is significantly increased.
Best Regards,
Marek Neuzil
Hi Marek,
Thanks for your reply,
I am not using processor expert, I am just editing in the Hello_world demo example with this float print.
I tried as per your suggestion, but I am not getting "Cross ARM C++ linker" option, I did in "Cross ARM C linker" but problem is not solved,
can you please do something.
hello,
please refer this article for how to use printf to print floating value in KDS3.0
Semihosting for Kinetis Design Studio V3.0.0 and GNU ARM Embedded (launchpad) | MCU on Eclipse
I also made a demo code on this related. see attached video, can this help you?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I am not getting "Cross ARM C++ linker" option.:smileyconfused:
are you sure you use KDS3.0?
please send me:
1. your KDS build ID.
2. your demo project
3. your KDS properties' screenshot.
thanks!
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------