- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using a PSOC5 CY8CKIT-050 dev board with PSOC creator 3.3 and cannot work with floating point numbers.
I made a small project to demonstrate the issue. I see that device.h cannot be found and I understand it should be generated automatically.
What am I missing?
Thanks in advance!
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is an example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also set the heap to 0x0200 in the .cydwr file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks bobgoar, but that example doesn't work. I get two errors and one warning:
Build errors: undefined reference to 'ftoa', undefined reference to 'LCD_PrString' (should be LCD_PrintString(), I think)
Warning: assignment makes pointer from integer without a cast
Printing a float to the LCD was just a simple example of my larger problem that I can't use floats. Is there a compiler switch or something else I'm missing? My example compiles and runs, but the float and double are not displayed. In my real project I use atof() to convert a string to float, but the result is always 0. I tried just printing a float and found that it didn't work, and it appears the float is not supported.
I think the answer is along the lines of dimas response here: http://www.cypress.com/forum/known-problems-and-solutions/how-can-i-use-function-sprintf-psoc-design... but I haven't been able to figure it out yet. My directory did not contain a local.mk so I created on and added CODECOMPRESSOR:=$(CODECOMPRESSOR) -lfpm8c, but it still doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make these settings also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks bobgoar, I mad those changes and still nothing...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also changed the lcd port to agree with my setup. You used P2(6:0) and I used P2(7:1) as that is how my board is wired .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a picture of the LCD.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! It is working now. Thanks for taking the time to help me and build the example!