You are here

How to display "56.7" on LCD of psoc3? | Cypress Semiconductor

How to display "56.7" on LCD of psoc3?

Summary: 2 Replies, Latest post by Gautam Das on 08 May 2011 01:32 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
nate's picture
9 posts

I wanna use LCD of Psoc3 to display somes datas such as 17.3 , 56.7 .......

is there any functions for this ?

uday's picture
Cypress Employee
569 posts

This can be achieved by printing 56 as a number followed by '  .  ' character and number 7.  To print any number the API, Char_LCD_PrintNumber() can be used. The same can be found in the "Char_LCD.h" file. To print the character dot, Char_LCD_PutChar() can be used. 

dasg's picture
Cypress Employee
730 posts



You can also do this with the aid of sprintf() function.

Declare an array of desired length. The length should also include one byte for the decimal point. The value to be displayed is stored in ASCII format in this array.

Then use sprintf() function for appropriate conversion from floating point value to the decimal value with appropriate number of digits after the decimal point.

The source should be the floating point value which has to be displayed, the destination should be the array which will store the ASCII value of all the digits including the decimal point.

Once this conversion is done, you can use simple PrintString API available for the LCD to display the content of the array.

Log in to post new comments.