帮我看下syntax error near'unsigned'是哪里错啊,我急死了
[复制链接]
帮我看下syntax error near'unsigned'是哪里错啊,我急死了,我是编程一段1到1000的数,为什么编译出来有错误呢?
#include<reg51.h> #define uint unsigned int #define uchar unsigned char uchar aa,unmp,qian,bai,shi,ge; void dingshi(); void dealy(uint z); void xs(uchar qian,uchar bai,uchar shi,uchar ge); uchar code table[]={0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d, 0x07,0x7f,0x6f};
void main() { dingshi(); while(1) { if(aa==20) { aa=0; unmp++; if(unmp==100) unmp=0; qian=unmp/1000; bai=unmp/100%10; shi=unmp/10%10; ge=unmp%10;
} xs(uchar qian,uchar bai,uchar shi,uchar ge); }
} void dingshi() { EA=1; ET0=1; TMOD=0x01; TR0=1; TH0=(65536-50000)/256; TL0=(65536-50000)%256; unmp=0; } void et0() interrupt 1 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; aa++; } void xs(uchar qian,uchar bai,uchar shi,uchar ge) { P0=table[qian]; P3=0xf7; dealy(5);
P0=table[bai]; P3=0xfb; dealy(5);
P0=table[shi]; P3=0xfd; dealy(5);
P0=table[ge]; P3=0xfe; dealy(5);
} void dealy(uint z) { uint x,y; for(x=200;x>0;x--) for(y=z;y>0;y--);
}
|