#include
void Delay(void)
{ unsigned int i;
for(i=50000;i>0;i--) ;
}
unsigned char qianw,baiw,shiw,gew,sum=0,i,j;
unsigned char duan[]={0x3f,0x06,0x5b,0x4f,0x66,0xbd,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
unsigned char wei[]={0xfe,0xfc,0xf80,0xf0};
void xians(unsigned char x,unsigned char y)
{
P1=duan[x];Delay();
P2=wei[y];
}
void main(void)
{
for(i=0;i<=5050;i++)
{ sum+=i;
qianw=sum/1000;
baiw=(sum%1000)/100;
shiw=((sum%1000)%100)/10;
gew=sum%10;
}
for(j=0;j<20;j++)
{ if(qianw==0)
{ if(baiw==0)
{ if(shiw==0)
{ xians(wei[0],gew); Delay();}
else {xians(wei[1],shiw); Delay();}
}
else {xians(wei[2],baiw); Delay();}
}
else {xians(wei[3],qianw); Delay();}
}
}
我这个程序可以运行,但与ptrotues联调不能实现,请问是怎么回事啊?帮我改一下好吗?谢谢了!
|