char LCD display

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Using sprintf,  i could display the integer (int16) on the LCD (PSoC creator, PSoC3). But i am finding problem in displaying  long int and int32. Pl suggest me.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Use %dl and %dL for other int-formats.

   

 

   

Bob

View solution in original post

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Use %dl and %dL for other int-formats.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Still i couldn't succeed. this is the code i have written. What's my mistake

   

char OutputString[12];

   

uint32 d;

   

d=75000;
LCD_Char_1_Position(1,1);
sprintf(OutputString,"%dI",d);
LCD_Char_1_PrintString(OutputString);

0 Likes
Anonymous
Not applicable

 Try this

   

sprintf(OutputString,"%ld",d)

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Sorry, my error it must be "%ld" and it is a "l" like "long" (small "L").

   

Look here: http://publications.gbdirect.co.uk/c_book/chapter9/formatted_io.html for formats.

   

Bob

0 Likes
Anonymous
Not applicable

it's working. thanks

0 Likes