为什么keil编译一直说未定义?程序如下
#include"reg51.h"#defineucharunsignedchar#defineuintunsignedintsbitin=p3_0;sbitout=p3...
#include "reg51.h"
#define uchar unsigned char
#define uint unsigned int
sbit in=p3_0;
sbit out=p3_1;
unsigned char second,timer;
void t1_init()
{
TMOD=0x10;
IE=0x88;
TH1=0x3c;
TR1=1;
}
void main()
{
t1_init();
second=0;
timer=0;
while(1);
}
void t1_func() interrupt 3
{
TH1=0x3c;
TL1=0xb0;
if(timer<20)
{
timer=timer-1;
}
else if(timer==20)
{
timer=0;
if(second==59)
{
second=0;
}
else
{
second=second+1;
}
}
p3_0=second/10;
p3_1=second%10;
}
总是说P3_0和P3_1没定义 展开
#define uchar unsigned char
#define uint unsigned int
sbit in=p3_0;
sbit out=p3_1;
unsigned char second,timer;
void t1_init()
{
TMOD=0x10;
IE=0x88;
TH1=0x3c;
TR1=1;
}
void main()
{
t1_init();
second=0;
timer=0;
while(1);
}
void t1_func() interrupt 3
{
TH1=0x3c;
TL1=0xb0;
if(timer<20)
{
timer=timer-1;
}
else if(timer==20)
{
timer=0;
if(second==59)
{
second=0;
}
else
{
second=second+1;
}
}
p3_0=second/10;
p3_1=second%10;
}
总是说P3_0和P3_1没定义 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询