|
void leddisp(void)
{
switch(lednum) //选择需要显示的数码位
{
case 0:
LED1 = segtab[led[0]];
break;
case 1:
LED2 = segtab[led[1]];
break;
case 2:
LED3 = segtab[led[2]];
break;
case 3:
LED4 = segtab[led[3]];
break;
case 4:
LED5 = segtab[led[4]];
break;
case 5:
LED6 = segtab[led[5]];
break;
case 6:
LED7 = segtab[led[6]];
break;
case 7:
LED8 = segtab[led[7]];
break;
}
if(lednum == 0) //更新需要显示的数码管位置
{
lednum = 7;
}
|
|