2 Replies Latest reply on May 8, 2011 1:32 PM by gautamd_

    How to display "56.7" on LCD of psoc3?

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


      is there any functions for this ?

        • 1. Re: How to display "56.7" on LCD of psoc3?

          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. 

          • 2. Re: How to display "56.7" on LCD of psoc3?





            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.