|
#include<AT89X51.H>
unsigned char dispcode[]={0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,0x00};
unsigned char count;
unsigned char temp;
void delay(unsigned char a)
{ unsigned char i,k,j;
for(i=10;i>0;i--)
for(j=9;j>0;j--)
for(k=a;k>0;k--);
}
void main(void)
{ SCON=0x50;
PCON=0X80;
TMOD=0X20;
TL1=0xF3;
TH1=0XF3;
ES=1;
EA=1;
TR1=1;
for(;;)
{
P1=dispcode[temp];
delay(2);
}
}
void serial(void) interrupt 4 using 0
{ count=SBUF;
RI=0;
temp=count
SBUF=++count;
do{;
}
while(TI==0);
TI=0;
}
老是显示pc.c(33): error C141: syntax error near 'SBUF', expected ';' |
|