PSoC Designer PSoC 4 Floating Numbers

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 So, I'm trying to print numbers of type float to an LCD screen using sprintf, but my screen isn't displaying things properly. I tested sprintf using integers, and I got that to work, but I still can't get floating numbers to show up. Originally my variables were of type float, but I've sinced changed them to type double. If anyone has a clue to why it's doing this, please let me know. My code is shown below. This is my first time posting, so I'm not sure how to properly copy and paste my code into this text box, so I've attached the file.

   

(FYI, the reason I have all LCD commands in the infinite for loop is becasue I need it to be updating regularly).

0 Likes
2 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Have you enabled nano library -

   

 

   

    

   

          http://www.cypress.com/?id=4&rID=87354     nano library

   

 

   

Also memory use changed, settings dropped, maybe increase them (note below is for PSOC 5LP) -

   

 

   

    

   

          

   

The heap and stack size were reduced in 3.1, try restoring to 3.0 levels 4K and 16K respectively.

   

3.1 default settings are now 128 bytes and 2K.

   

 System tab in Fitterxxxxx*.cydwr file, workspace explorer near the top.

   

 

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Actual version for Creator is now 3.2 (has just rolled out) some minor changes:

   

Under  Project -> Build Settings -> Linker -> General you will find two entries concerning newlib-nano. Set both of them to TRUE.

   

As Dana pointed to: Set the heap-size in the system-view of the .cydwr file to (at least) 0x0100 bytes.

   

 

   

Bob

0 Likes