You are here

Display a Long on LCD | Cypress Semiconductor

Support & Community

Display a Long on LCD

Last Updated: February 27, 2011

How do I 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);


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

Knowledge Base Tags: 

Provide feedback on this article

Browse KB By Product

Browse KB by Type