#include<reg51.h>
#define uchar unsigned char
uchar disdat[8]={0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80};
main()
{
uchar a;
while(1)
{
P2=0xc0;
while(!P3_3)
{
a=0;
if(P0_0){a=1;break;}
if(P0_1){a=2;break;}
if(P0_2){a=3;break;}
if(P0_3){a=4;break;}
if(P0_4){a=5;break;}
if(P0_5){a=6;break;}
if(P0_6){a=7;break;}
if(P0_7)continue;
}
do{
P1_0=0;
P2=disdat[a];
}while(!P3_2)
P1_0=1;
P2=0xff;
}
}
追问
就是想让上图的八路抢答器运行起来,但是用不了。。。。我不太懂。。。可以帮忙看一下吗?谢谢你啦。