keil中已经定义了为什么编译还说未定义? 5
#include<reg51.h>sbitS1=P1^0;sbitS2=P1^1;sbitS3=P1^2;sbitS4=P1^3;sbitled1=P0^3;sbitle...
#include <reg51.h>
sbit S1=P1^0;
sbit S2=P1^1;
sbit S3=P1^2;
sbit S4=P1^3;
sbit led1=P0^3;
sbit led2=P0^2;
sbit led3=P0^1;
sbit led4=P1^0;
sbit zheng=P0^6;
sbit fan=P0^7;
void delay02s();
void djzz;
void djfz;
void djtz;
void delay02s()
{
unsigned int i;
for(i=0;i<20000;i++);
}
void djzz()
{
fan=1;zheng=1;
delay02s();
zheng=0;
}
void djfz()
{
fan=1;zheng=1;
delay02s();
fan=0;
}
void djtz()
{
fan=1;zheng=1;
}
void main()
{
P1=0xff;
P2=0xff;
while(S1==1);
led1=0;
while(1)
{
if (S2==0)
{
led2=0;led3=1;led4=1;
djzz();
}
if (S3==0)
{
led2=1;led3=0;led4=1;
djfz();
}
if (S4==0)
{
led2=1;led3=1;led4=0;
djtz();
}
}
} 展开
sbit S1=P1^0;
sbit S2=P1^1;
sbit S3=P1^2;
sbit S4=P1^3;
sbit led1=P0^3;
sbit led2=P0^2;
sbit led3=P0^1;
sbit led4=P1^0;
sbit zheng=P0^6;
sbit fan=P0^7;
void delay02s();
void djzz;
void djfz;
void djtz;
void delay02s()
{
unsigned int i;
for(i=0;i<20000;i++);
}
void djzz()
{
fan=1;zheng=1;
delay02s();
zheng=0;
}
void djfz()
{
fan=1;zheng=1;
delay02s();
fan=0;
}
void djtz()
{
fan=1;zheng=1;
}
void main()
{
P1=0xff;
P2=0xff;
while(S1==1);
led1=0;
while(1)
{
if (S2==0)
{
led2=0;led3=1;led4=1;
djzz();
}
if (S3==0)
{
led2=1;led3=0;led4=1;
djfz();
}
if (S4==0)
{
led2=1;led3=1;led4=0;
djtz();
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询