keil不能for循环
#include<reg51.h>sbitLed1=P0^0;sbitLed2=P0^1;voiddelay(unsignedinti){while(i){i--;}}v...
#include<reg51.h>
sbit Led1=P0^0;
sbit Led2=P0^1;
void delay(unsigned int i)
{
while(i)
{
i--;
}
}
void main()
{
int i=4;
while(1)
{
P0=0xff;
Led1=0;
for(;i<1;i--)
{
P0=P0<<2;
delay(10000);
}
P0=0xff;
Led2=0;
for(;i<1;i--)
{
P0=P0<<2;
delay(10000);
}
}
} 展开
sbit Led1=P0^0;
sbit Led2=P0^1;
void delay(unsigned int i)
{
while(i)
{
i--;
}
}
void main()
{
int i=4;
while(1)
{
P0=0xff;
Led1=0;
for(;i<1;i--)
{
P0=P0<<2;
delay(10000);
}
P0=0xff;
Led2=0;
for(;i<1;i--)
{
P0=P0<<2;
delay(10000);
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询