第七行为什么报错
本帖最后由 zmllzw 于 2021-11-24 17:41 编辑#include<reg51.h>
sbit P04 = P0^4;
unsigned char ucLed = 1;
void Delay_200ms()
{
unsigned char i=0;
if (i=0;i<4;i++)
{
TH1=0X3C;
TL1=0Xb0;
TR1=0;
while(!TF1);
TF1=0;
}
}
void main(void)
{
TMOD=0X10;
while(1)
{
P0=~ucLed;
Delay_200ms();
if(P04)
{
ucLed <<= 1;
if(ucLed == 0x10)
ucLed=1;
}
}
}
流水灯.C(7): error C141: syntax error near ';'
流水灯.C(7): error C141: syntax error near ')' if (i=0;i<4;i++)
改为
for(i=0;i<4;i++)
页:
[1]