#define SENSOR_LEFT 0x????
#define SENSOR_RIGHT 0x????
#define MOTOR_LEFT 0x????
#define MOTOR_RIGHT 0x????
int Func()
{
while (1)
{
if ((1 ==SENSOR_LEFT) &&(1 ==SENSOR_RIGHT))
{
MOTOR_LEFT = 0
MOTOR_RIGHT = 0
}
else if (1 ==SENSOR_LEFT)
{
MOTOR_LEFT = 1
MOTOR_RIGHT = 0
}
else if (1 ==SENSOR_RIGHT)
{
MOTOR_LEFT = 0
MOTOR_RIGHT = 1
}
else
{
MOTOR_LEFT = 1
MOTOR_RIGHT = 1
}
}
}
修改为:void Avoid()
{
while(S <400)/银薯/设置避障距离
{
beep = 0//锋友者使能蜂鸣告败器
stop()//停车
}
beep = 1//关闭蜂鸣器
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)