#include<BoeBot.h>
#include<uart.h>
#include<REG52.H>


int P1_4state(void)//获取P1_4的状态,右胡须
{
return (P1&0x10)?1:0;
}
int P2_3state(void)//获取P2_3的状态,左胡须
{
return (P2&0x08)?1:0;
}

void Forward(void)
{
P1^1 = 1;
delay_nus(1700);
P1^1 = 0;
P1^0 = 1;
delay_nus(1300);
P1^0 = 0;
delay_nms(20);
}
void Left_Turn(void)
{
int i;
for(i=1;i<=26;i++)
{
P1^1 = 1;
delay_nus(1300);
P1^1 = 0;
P1^0 = 1;
delay_nus(1300);
P1^0 = 0;
delay_nms(20);
}
}
void Right_Turn(void)
{
int i;
for(i=1;i<=26;i++)
{
P1^1 = 1;
delay_nus(1700);
P1^1 = 0;
P1^0 = 1;
delay_nus(1700);
P1^0 = 0;
delay_nms(20);
}
}
void Backward(void)
{
int i;
for(i=1;i<=65;i++)
{
P1^1 = 1;
delay_nus(1300);
P1^1 = 0;
P1^0 = 1;
delay_nus(1700);
P1^0 = 0;
delay_nms(20);
}
}

int main(void)
{
uart_Init();
printf("Program Running!\n");

while(1)
{
if((P1_4state()==0)&&(P2_3state()==0))
{
Backward(); //向后
Left_Turn();//向左
Left_Turn();//向左
}
else if(P1_4state()==0)
{
Backward();//向后
Left_Turn();//向左
}
else if(P2_3state()==0)
{
Backward();//向后
Right_Turn();//向右
}
else
Forward();//向前
}
}

error c141:syntax error near ‘=’;
error c141:syntax error near ‘=’
error c141:syntax error near ‘=’
error c141:syntax error near ‘=’

小女子是菜鸟 ……这是什么错误啊?怎么改?? 好像是P1^1 = 0的'='
happy……happy……