How to achieve a bigger value of counting in C?

Status
Not open for further replies.

tom_hanks

Full Member level 5
Joined
Aug 28, 2003
Messages
243
Helped
14
Reputation
28
Reaction score
1
Trophy points
1,298
Activity points
1,571
hi,

I have two counter in uC...8 bit

now i want to acheive a biggeer value of counting in C...

what is possible way to acheive the bigger value of counting for C & uC...


tom
 

counting in C...

what are these declared as ? int?
make it a long int .
 

Re: counting in C...

i declare it as


volatile unsigned char ms_100_count;
 

Re: counting in C...

Define Array of Char as long as you want then make a function that increament in array
 

Re: counting in C...

declare it as
unsigned long ms_100_count;

so u can count upto 0xFFFFFFFF
 

Re: counting in C...

If you want still bigger declare it as long long type, which is i think 8 bytes long
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…