#include
//#include
#define uchar unsigned char
#define uint unsigned int
sbit dula=P2^6;
sbit wela=P2^7;
uchar code tabdu[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x86,0x8e};
uchar code tabwe[]={
0xfe,0xfd,0xfb,0xf7};
uchar tt,numdu,numwe;
void init();
void main()
{
init(); //居然加上了VOID 结果我白白调试了将近一个小时气死人了
while(1)
{
}
}
void init()
{
numdu=1;
numwe=0;
TMOD=0x01;
EA=1;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
ET0=1;
TR0=1;
}
void time1() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tt++;
if(tt==10)
{
tt=0;
wela=1;
P2=tabwe[numwe];
wela=0;
numwe++;
if(numwe==4)
numwe=0;
dula=1;
P0=tabdu[numdu];
dula=0;
numdu++;
if(numdu==16)
numdu=1;
}
}
啥也不说了,细节的问题好久才看出来。越是细节越是最最简单的错误越不容易发现