Desired output 0-999, please help

Status
Not open for further replies.

Filipe Aparicio

Newbie level 3
Joined
Feb 3, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,318


Hi all, could u help me to create the codes using MikroC for the circuit shown in the picture. I have tried it but all the segment count same number(ex 0000, 1111, 2222 and so on), but the desired output is ex. 0001, 0002,....0010, 0011 and so on until 0999... Please help.
 

Hi MAAM, these are the codes that I am using... but I dont know how to make the first 3 digits to be zero and count start from the last digit(example 0001, 0002, 0003.....up to 0999.


void main()

{
TRISB=0;
TRISC=0;
{
while(1)
{
PORTB=0x3F;
delay_ms(500);
PORTB=0x06;
delay_ms(500);
PORTB=0x5B;
delay_ms(500);
PORTB=0x4F;
delay_ms(500);
PORTB=0x66;
delay_ms(500);
PORTB=0x6D;
delay_ms(500);
PORTB=0x7D;
delay_ms(500);
PORTB=0x07;
delay_ms(500);
PORTB=0x7F;
delay_ms(500);
PORTB=0x6F;
delay_ms(500);
PORTB=0x3F;
delay_ms(500);
PORTB=0x06;
delay_ms(500);
PORTB=0x5B;
delay_ms(500);
PORTB=0x4F;
delay_ms(500);
PORTB=0x66;
delay_ms(500);
PORTB=0x6D;
delay_ms(500);
PORTB=0x7D;
delay_ms(500);
PORTB=0x07;
delay_ms(500);
PORTB=0x7F;
delay_ms(500);
PORTB=0x6F;
delay_ms(500);

}
while(1);

}
}
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…