switch(j) { //For the seven segment display for seconds
case 0 :output_d(0x06);
output_a(0x3F);
break;
case 1 :output_d(0x5B);
output_a(0x3F);
break;
case 2 :output_d(0x4F);
output_a(0x3F);
break;
case 3 :output_d(0x66);
output_a(0x3F);
break;
case 4 :output_d(0x6D);
output_a(0x3F);
break;
case 5 :output_d(0x3F);
output_a(0x3F);
break;
}
}
if (j==5){ //For the seven segment display for minutes
i++;
switch(i){
case 1 :output_b(0x06);
break;
case 2 :output_b(0x5B);
break;
case 3 :output_b(0x4F);
break;
case 4 :output_b(0x66);
break;
case 5 :output_b(0x6D);
break;
case 6 :output_b(0x7D);
break;
case 7 :output_b(0x07);
break;
case 8 :output_b(0xFF);
break;
case 9 :output_b(0x67);
i=-1;
break;
default: output_b(0x3F);
}
}
}
}
if (input(PIN_C1)){ //TO reset the stopwatch
output_b (0x3F) ; //display will show a 0
output_d (0x3F) ; //display will show a 0
output_a (0x3F) ; //display will show a 0
i=0;
j=0;
goto start;
}
}
}
_________________ naren
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
Re: Multiplexing
Posted: Tue Nov 29, 2016 4:13 am
naren wrote:
Can anyone teach how to convert this c code to multiplexing since I used different ports for different 7 segment display.
Learn to use the code button, it preserves formatting and should make your code easier to read.
I don't understand your question.
Are you wanting to drive all your LED cathodes from one port and anodes from another?
If so there are loads of examples on this forum and CCS.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum