请问这个单片机程序编译通不过的原因? BCD.C(4): error C129: missing ';' before 'code'
#include<reg52.h>#defineuintunisgnedint//#defineucharunisgnedcharucharcodetable[]={0x...
#include <reg52.h>
#define uint unisgned int
//#define uchar unisgned char
uchar code table[]={0x28, 0x7e, 0xa2, 0x62, 0x74, 0x61, 0x21, 0x7a};
void delay(uint);
void main()
{while(1)
{P0=table[0];
P2=0xfe;
delay(1);
P0=table[1];
P2=0xfd;
delay(1);
P0=table[2];
P2=0xfb;
delay(1);
P0=table[3];
P2=0xf7;
delay(1);
P0=table[4];
P2=0xef;
delay(1);
P0=table[5];
P2=0xdf;
delay(1);
P0=table[6];
P2=0xbf;
delay(1);
P0=table[7];
P2=0x7f;
delay(1); }
}
void delay(uint z)
{uint i,j;
for (i=z;i>0;i--)
for (j=124;j>0;j--);
} 展开
#define uint unisgned int
//#define uchar unisgned char
uchar code table[]={0x28, 0x7e, 0xa2, 0x62, 0x74, 0x61, 0x21, 0x7a};
void delay(uint);
void main()
{while(1)
{P0=table[0];
P2=0xfe;
delay(1);
P0=table[1];
P2=0xfd;
delay(1);
P0=table[2];
P2=0xfb;
delay(1);
P0=table[3];
P2=0xf7;
delay(1);
P0=table[4];
P2=0xef;
delay(1);
P0=table[5];
P2=0xdf;
delay(1);
P0=table[6];
P2=0xbf;
delay(1);
P0=table[7];
P2=0x7f;
delay(1); }
}
void delay(uint z)
{uint i,j;
for (i=z;i>0;i--)
for (j=124;j>0;j--);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询