1个回答
展开全部
}
else
{
SetMotor(0x1111,(int)(80*gf_1),(int)(-20*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(33*gf_1),(int)(100*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_B_2h1( ) /*沿右墙B:二号回家第一段*/
{
ma_5 = AI(4);
ma_6 = AI(5);
if((ma_6 > gi_9) && (ma_5 < ma_10))
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-100*gf_1),0,0);
}
else
{
if((ma_6 > gi_9) && (ma_5 > ma_10))
{
if(ma_5 > 350)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(10*gf_1),(int)(-80*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-33*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_B( ) /*沿右墙B*/
{
ma_5 = AI(4);
ma_6 = AI(5);
if((ma_6 > gi_9) && (ma_5 < ma_10))
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-100*gf_1),0,0);
}
else
{
if((ma_6 > gi_9) && (ma_5 > ma_10))
{
if(ma_5 > 350)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(10*gf_1),(int)(-80*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-33*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_B_Z( ) /*沿右墙B_走中间*/
{
ma_5 = AI(4);
ma_6 = AI(5);
if((ma_6 > gi_9) && (ma_5 < ma_10))
{
if(ma_6 > 500){SetMotor(0x1111,(int)(-60*gf_1),(int)(-100*gf_1),0,0);}
else if(ma_6 < 400){SetMotor(0x1111,(int)(-100*gf_1),(int)(-60*gf_1),0,0);}
else{SetMotor(0x1111,(int)(-100*gf_1),(int)(-100*gf_1),0,0);}
}
else
{
if((ma_6 > gi_9) && (ma_5 > ma_10))
{
if(ma_5 > 350)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(10*gf_1),(int)(-80*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-33*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_fire ()/*4号门口沿右墙准备进房灭火的*/
{
ma_2 = AI(1);
ma_3 = AI(2);
if((ma_3 > gi_9) && (ma_2 < (ma_10+40)))
{
SetMotor(0x1111,(int)(100*gf_1),(int)(100*gf_1),0,0);
}
else
{
if((ma_2 > (ma_10+40)) && (ma_3 > gi_9))
{
if(ma_2 > 330)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(80*gf_1),(int)(-25*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(23*gf_1),(int)(100*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_2h( )/*沿右墙:2号回家第二段*/
{
ma_2 = AI(1);
ma_3 = AI(2);
if((ma_3 > gi_9) && (ma_2 < ma_10))
{
SetMotor(0x1111,(int)(100*gf_1),(int)(100*gf_1),0,0);
}
else
{
if((ma_2 > ma_10) && (ma_3 > gi_9))
{
if(ma_2 > 330)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(80*gf_1),(int)(-25*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(33*gf_1),(int)(100*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_1h( )/*沿右墙:1号回家*/
{
ma_2 = AI(1);
ma_3 = AI(2);
if((ma_3 > gi_9) && (ma_2 < ma_10))
{
SetMotor(0x1111,(int)(100*gf_1),(int)(100*gf_1),0,0);
}
else
{
if((ma_2 > ma_10) && (ma_3 > gi_9))
{
if(ma_2 > 330)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
else
{
SetMotor(0x1111,(int)(80*gf_1),(int)(-20*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(33*gf_1),(int)(100*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_B_2h1( ) /*沿右墙B:二号回家第一段*/
{
ma_5 = AI(4);
ma_6 = AI(5);
if((ma_6 > gi_9) && (ma_5 < ma_10))
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-100*gf_1),0,0);
}
else
{
if((ma_6 > gi_9) && (ma_5 > ma_10))
{
if(ma_5 > 350)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(10*gf_1),(int)(-80*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-33*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_B( ) /*沿右墙B*/
{
ma_5 = AI(4);
ma_6 = AI(5);
if((ma_6 > gi_9) && (ma_5 < ma_10))
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-100*gf_1),0,0);
}
else
{
if((ma_6 > gi_9) && (ma_5 > ma_10))
{
if(ma_5 > 350)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(10*gf_1),(int)(-80*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-33*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_B_Z( ) /*沿右墙B_走中间*/
{
ma_5 = AI(4);
ma_6 = AI(5);
if((ma_6 > gi_9) && (ma_5 < ma_10))
{
if(ma_6 > 500){SetMotor(0x1111,(int)(-60*gf_1),(int)(-100*gf_1),0,0);}
else if(ma_6 < 400){SetMotor(0x1111,(int)(-100*gf_1),(int)(-60*gf_1),0,0);}
else{SetMotor(0x1111,(int)(-100*gf_1),(int)(-100*gf_1),0,0);}
}
else
{
if((ma_6 > gi_9) && (ma_5 > ma_10))
{
if(ma_5 > 350)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(10*gf_1),(int)(-80*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(-100*gf_1),(int)(-33*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_fire ()/*4号门口沿右墙准备进房灭火的*/
{
ma_2 = AI(1);
ma_3 = AI(2);
if((ma_3 > gi_9) && (ma_2 < (ma_10+40)))
{
SetMotor(0x1111,(int)(100*gf_1),(int)(100*gf_1),0,0);
}
else
{
if((ma_2 > (ma_10+40)) && (ma_3 > gi_9))
{
if(ma_2 > 330)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(80*gf_1),(int)(-25*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(23*gf_1),(int)(100*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_2h( )/*沿右墙:2号回家第二段*/
{
ma_2 = AI(1);
ma_3 = AI(2);
if((ma_3 > gi_9) && (ma_2 < ma_10))
{
SetMotor(0x1111,(int)(100*gf_1),(int)(100*gf_1),0,0);
}
else
{
if((ma_2 > ma_10) && (ma_3 > gi_9))
{
if(ma_2 > 330)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
}
else
{
SetMotor(0x1111,(int)(80*gf_1),(int)(-25*gf_1),0,0);
}
}
else
{
SetMotor(0x1111,(int)(33*gf_1),(int)(100*gf_1),0,0);
}
}
//wait( 0.001000 );
}
void RightWay_1h( )/*沿右墙:1号回家*/
{
ma_2 = AI(1);
ma_3 = AI(2);
if((ma_3 > gi_9) && (ma_2 < ma_10))
{
SetMotor(0x1111,(int)(100*gf_1),(int)(100*gf_1),0,0);
}
else
{
if((ma_2 > ma_10) && (ma_3 > gi_9))
{
if(ma_2 > 330)
{
SetMotor(0x1111,(int)(28*gf_1),(int)(-28*gf_1),0,0);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询