Continue to Site

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.

display a value greater than unsigned long int on lcd......

Status
Not open for further replies.

jit_singh_tara

Full Member level 6
Joined
Dec 22, 2006
Messages
325
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,298
Location
Delhi , India
Activity points
4,293
Dear friends ,
can we have counter as a variable ,whose value is greater than unsigned long int (4294967295) ,

i want to increment a variable which should go from 0 - 9999999999 , this range is out of range from unsigned long int , i have to display the data on lcd ,

plz suggest how do i get this value in a variable or there is some other option available , using mikroc compiler v5.2 .


thanks and regards
Jitender Singh
 

Hello!

It doesn't sound like something beyond the technology, but we have first
to know a bit more about it. If it's a plain counter of SIZE digits, then you can use
a char array. If you want to increment the counter, you start incrementing the
last digit. If it becomes more than '9' then set it to '0' and increment the previous
one and so on.

Now if it's not a plain counter (i.e. if you want to add for instance a 5 figures number,
then you have to do the above process for every digit, so it's more complicated, but
anyway even on a 8-bit processor, you can do 32-bit arithmetic, whether or not you
use MicroC.

Dora.
 

You need to seperate to couple of integer, or array.

Code:
unsigned int var[3];

var[1]=var[1]+var[0]/1000;
var[0]=var[0]%1000;

var[2]=var[2]+var[1]/1000;
var[1]=var[1]%1000;
So, var[1] will increments 1 if var[0] exceed 1000. var[2] will increments if var[1] exceed 1000.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top