Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with displaying digits on a LCD

Status
Not open for further replies.

eason_terrorist

Newbie level 4
Joined
Nov 10, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
Hey everyone,

I have some problem with my LCD.
The problem is when i from 1 increase to 100, the LCD show normal.
But i decrease from 100 to 1, there is some problem showing in the LCD

when from 100 decrease to 99, my lcd will show 990----> how to clear the zero behind the 99?
 

DineshSL

Advanced Member level 1
Joined
May 10, 2010
Messages
403
Helped
121
Reputation
242
Reaction score
116
Trophy points
1,343
Location
Sri Lanka
Activity points
3,551
Re: Problem with the LCD

Hi,
Best way is to write all 3-digits every time. Then number is aligned to right; So it would be 001,002,...099,100.
For that you may write Hundreds-digit first then tens-digit then units-digit.

When you decrease also, you should write all three digits; so it would be 100,099,098...001

Or you may write "Space" (ASCII 32) when ever you want to delete a character where cursor is at; this way you can remove un-necessary tailing digits.

Wish you success !
 

eason_terrorist

Newbie level 4
Joined
Nov 10, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
Re: Problem with the LCD

thank for reply....can u show me some example?i dun understand how to do that
 

VSMVDD

Banned
Joined
Jun 12, 2005
Messages
646
Helped
92
Reputation
184
Reaction score
34
Trophy points
1,308
Location
scotland uk
Activity points
0
Re: Problem with the LCD

if its c your using

when you printf the value
you can use
%.1d this gives 2 decimal number or

like

char decimal=23;
printf( "%.1d",decimal);

will print 23 and not 23.0 or 023


Tips on printf

see here for a list of the control charicters for printf
 

DineshSL

Advanced Member level 1
Joined
May 10, 2010
Messages
403
Helped
121
Reputation
242
Reaction score
116
Trophy points
1,343
Location
Sri Lanka
Activity points
3,551
Re: Problem with the LCD

Hi,
Follow this tutorial;(it's in Mplab-assembly)
PIC Tutorial  Three - LCD Modules -Tutorial 3.2

It converts 16bit Binary to Decimal and store 5 digits on separate 5 registers;
Then it always writes these 5 digits on LCD.

I guess you count something like a pulse; which always have increment or decrement by 1 only. Is it ?
If so it would be more easy to code. If you explain how you have stored your number in memory(like in a single-register or 3-registers for 3-digits); more specific explanation can be showed.

Thank you,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top