- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am using psoc 6 and I have created a new function to measure a pin called ref and I used it to calculate a variable called ReflectometerReading. However, I am trying to display ReflectometerReading in uart and I am not able to.I have attached the project. Can you help please?
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
aliissa02,
Rakesh is correct.
I compiled your program and loaded onto a CY8CKIT-062-BLE. Here's my term output:
Before ==> "Use newlib-nano Float Formatting" = False
...
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
...
then I made the change as directed by Rakesh. Here's my term output:
After ==> "Use newlib-nano Float Formatting" = True
...
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 646 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
...
With this build setting for the linker, I get text for the floating variable. Although my data is "0.000000" (I do not have an AD8307), floating variable require the linker setting to print correctly.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @aliissa02 ,
If you are trying to print certain floating point numbers in your project then kindly enable newlib-nano float formatting in the build settings of PSoC Creator. Please follow the steps from this KBA to enable it.
Best Regards,
Rakesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. But the main problem is that I am using countreference0 in another function other than the main which is why its not working. How do I get it working?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
aliissa02,
Rakesh is correct.
I compiled your program and loaded onto a CY8CKIT-062-BLE. Here's my term output:
Before ==> "Use newlib-nano Float Formatting" = False
...
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
reflectometer = mV
battery = 706 mV
temp = 645 mV
...
then I made the change as directed by Rakesh. Here's my term output:
After ==> "Use newlib-nano Float Formatting" = True
...
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 646 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
reflectometer = 0.000000 mV
battery = 706 mV
temp = 645 mV
...
With this build setting for the linker, I get text for the floating variable. Although my data is "0.000000" (I do not have an AD8307), floating variable require the linker setting to print correctly.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for this!