i wanna make a counter that goes from 00 to 59 using two bcd displayers , how can i do this and please i need some youtube channels that would help improve myself .
the program is the following :
i wanna make a counter that goes from 00 to 59 using two bcd displayers , how can i do this and please i need some youtube channels that would help improve myself .
the program is the following :
show your schematic ....
I can suppose, the 2 BCD displayers are connected on PORT B
MSB on B7..B4 (0 to 5 ) and LSB on B3 ..B0 (0 to 9)
don't increase "i" in the loop, it is allready done inside "for" instruction
Code:
void main ()
{
do
{
TRISB=0;
for(i=0; i<5; i++);
{
for(j=0; j<9; j++);
{
PORTB=( i<<4 ) | j ; // combine the two i=MSB and j=LSB
delay_ms(1000);
}
}
while(1);
}
I was referring to the OP's post. I must admit that had not seen your code which, of course, uses this construct properly.
Apologies for the confusion.
Susan