- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
There have been many contestants who have faced difficulty while using math functions in PSoC Creator using PSoC5's GCC Compiler even after including the 'math.h' header file.
Please undertake the following to eliminate the Build error:
Goto Project > Build Settings > Linker > General > Additional Libraries. Now type m in the Additional Libraries field.
Now, after the project Builds without any math error.
Refer to the KB article at the following link: http://www.cypress.com/?id=4&rID=42838
Regards,
dasg
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I want to include other libraries, do I have to use another letter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all
This may help me to proceed for my purchase of PSOC5 kit from other delevelopment kit.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am taking lazy appoach to answer, but make a quick sample testbench project,
do a library call, and see if it works. The beauty of our tools today is ability to
self test ideas quickly in a GUI environment.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I already used atan, sin etc, they (of course) work as expected. Just #include math.h
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use "-lm" as linker command line option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using PSOC 4.0, trying to print values out of the code below
double x, y, result;
char dataPrint[50];
x = -10.0;
y = 10.0;
result = atan2 (y,x) * 180 / M_PI;
sprintf(dataPrint, "result %lf \r\n", result) ;
UART_DEB_UartPutChar(dataPrint);
I am not able to print the float/double values. I have followed instructions on the link http://www.cypress.com/?id=4&rID=87354 and also increased the heap size. please let me know if I am missing on anything.
Thank you,
Likhitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do not use PutChar(), use PutString()
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob. Silly mistake.. It works now..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome with silly mistakes ;-))
Bob