cancel
Showing results for 
Search instead for 
Did you mean: 

Knowledge Base Articles

Display a Long on LCD

Anonymous
Not applicable

Display a Long on LCD

Translation - Japanese: LCDにLongを表示する - Community Translated (JA)

Question: How do I display a long variable on the LCD using the PSoC C-compiler?

Answer:

A long can be converted to ascii using the ltoa function and then displayed on an LCD using the LCD_PrString function.  An example code snippet is shown below.

#include <stdlib.h>

void main(void)
{
    long myLong = 134546;
    char OutputString[12];

   ltoa(OutputString, myLong, 10);
    LCD_Position(0,0);
    LCD_PrString(OutputString);

}

Details of the ltoa function may be found in the "C Language User Guide" under the Help >> Documentation menu in PSoC Designer

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎Feb 27, 2011 12:18 PM
Updated by:
Anonymous
 
Contributors