用keilc51编译以下内容,出现出现error C202: 'P3_0': undefined identifier error C202怎么定义 5
#include<reg51.h>#defineuncharunsignedchar#defineunintunsignedintunsignedcharcodedisp...
#include<reg51.h>
#define unchar unsigned char
#define unint unsigned int
unsigned char code dispcode[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,
0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x84,0xff,0xbf};
unsigned char dispbitcode[]={0xfe,0xfd,0xfb,0xf7};
unsigned char dispbuf[4]={0,0,0,0};
unsigned char dispbitcnt;
unint mstcnt;
unint i;
unint count=0;
unchar tp=0;
void ledshow();
void keyscan();
void delay();
void just();
void turn();
void motorstop();
void speedup();
void speeddown();
void main(void)
{
P3_0=1;
P3_1=0;
dispbuf[0]=16;
TMOD=0x02;
TH0=0x06;
TL0=0x06;
TR0=1;
ET0=1;
EA=1;
while(1)
{
ledshow();
keyscan();
}
}
编译出来显示
1.C(26): error C202: 'P3_0': undefined identifier
1.C(27): error C202: 'P3_1': undefined identifier 展开
#define unchar unsigned char
#define unint unsigned int
unsigned char code dispcode[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,
0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x84,0xff,0xbf};
unsigned char dispbitcode[]={0xfe,0xfd,0xfb,0xf7};
unsigned char dispbuf[4]={0,0,0,0};
unsigned char dispbitcnt;
unint mstcnt;
unint i;
unint count=0;
unchar tp=0;
void ledshow();
void keyscan();
void delay();
void just();
void turn();
void motorstop();
void speedup();
void speeddown();
void main(void)
{
P3_0=1;
P3_1=0;
dispbuf[0]=16;
TMOD=0x02;
TH0=0x06;
TL0=0x06;
TR0=1;
ET0=1;
EA=1;
while(1)
{
ledshow();
keyscan();
}
}
编译出来显示
1.C(26): error C202: 'P3_0': undefined identifier
1.C(27): error C202: 'P3_1': undefined identifier 展开
2017-07-29
展开全部
都两年前的问题了,都没人回答,撑个场吧
如果你是想表示P3.0口的话,要写成P3^0,不是P3_0
下面的P3_1也一样的问题
如果你是想表示P3.0口的话,要写成P3^0,不是P3_0
下面的P3_1也一样的问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询