Displaying a long variable on LCD
Anonymous
Not applicable
Feb 27, 2011
12:18 PM
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Feb 27, 2011
12:18 PM
How to display a long variable on the LCD using the PSoC C-compiler?
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.
Translation - Japanese: LCDにLongを表示する - Community Translated (JA)
Labels
Rate this article: