单片机c程序老是报错出现missing";"
#include<reg51.h>#defineGPIO_DIGP0#defineGPIO_PLACEP2unsignedcharcodeDIG_PLACE[8]={0x...
#include <reg51.h>
#define GPIO_DIG P0
#define GPIO_PLACE P2
unsigned char code DIG_PLACE[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code DIG_CODE[16]={0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71};
unsigned char Display Date[8];
void Dig Display();
void main()
{
unsigned char i;
for(i=0;i<8;i++)
{
Display Date[i]=DIG_CODE[i];
}
while(1)
{
Dig Display();
}
}
void Dig Display()
{
unsigned char i;
unsigned int j;
for (i=0;i<8;i++)
{
GPIO_PLACE=DIG_PLACE[i];
GPIO_DIG=Display Date[i];
j=10;
while(j--);
GPIO_DIG=0x00;
}
} 展开
#define GPIO_DIG P0
#define GPIO_PLACE P2
unsigned char code DIG_PLACE[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char code DIG_CODE[16]={0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71};
unsigned char Display Date[8];
void Dig Display();
void main()
{
unsigned char i;
for(i=0;i<8;i++)
{
Display Date[i]=DIG_CODE[i];
}
while(1)
{
Dig Display();
}
}
void Dig Display()
{
unsigned char i;
unsigned int j;
for (i=0;i<8;i++)
{
GPIO_PLACE=DIG_PLACE[i];
GPIO_DIG=Display Date[i];
j=10;
while(j--);
GPIO_DIG=0x00;
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询