一个简单问题你
char code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};; 后面多了一个分号,是大全角字符,你把它去掉编译器就不会报错了
#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};
//延时程序
void delayMS(uint x)
{
uint i;
while(x--)
{
for(i=0;i<165;i++);
}
}
//主程序
void main()
{ uchar i=0;
P1=0x00;
while(1)
{
P1=~DSY_CODE[i];
i=(i+1)%10 ;
delayMS(300);
}
}