delay(5000);
nxshield.bank_b.motorRunUnlimited(SH_Motor_1, SH_Direction_Forward, 20);//Bank B 的Motor-1以馬力20正轉,機器人將手臂往下壓
delay(2000);
nxshield.bank_a.motorRunUnlimited(SH_Motor_Both, SH_Direction_Reverse, 20);//Bank A 的Motor-1,Motor-2以馬力20反轉,向前進
delay(2000);
nxshield.bank_a.motorRunUnlimited(SH_Motor_Both, SH_Direction_Forward, 30);//Bank A 的Motor-1,Motor-2以馬力20反轉,碰到蓋子後向後退
delay(500);
nxshield.bank_a.motorStop(SH_Motor_Both, SH_Next_Action_BrakeHold);//Bank A 的Motor-1,Motor-2停止鎖死
nxshield.bank_b.motorRunDegrees(SH_Motor_1,
SH_Direction_Reverse,
60,
70,
SH_Completion_Wait_For,
SH_Next_Action_BrakeHold);//Bank B 的Motor-1以馬力60反轉70度,機器人手臂向上抬一個角度
nxshield.bank_a.motorRunDegrees(SH_Motor_Both,
SH_Direction_Reverse,
30,
230,
SH_Completion_Wait_For,
SH_Next_Action_BrakeHold);
//Bank A 的Motor-1,Motor-2以馬力30反轉230度,機器人向前進一小段距離,只要改變這段距離就可以解決正方形或者是三角形的題型
nxshield.bank_b.motorRunUnlimited(SH_Motor_1, SH_Direction_Forward, 100);//Bank B 的Motor-1以馬力100正轉,機器人將手臂全力往下壓
for(int i = 0; i < 5; i++)
{
nxshield.bank_a.motorRunUnlimited(SH_Motor_Both, SH_Direction_Reverse, 30);
delay(130);
nxshield.bank_a.motorRunUnlimited(SH_Motor_Both, SH_Direction_Forward, 30);
delay(100);
}//前後來回壓球,使得進球率變高
nxshield.bank_a.motorStop(SH_Motor_Both, SH_Next_Action_BrakeHold);//Bank A 的Motor-1,Motor-2停止鎖死
nxshield.bank_b.motorRunUnlimited(SH_Motor_1, SH_Direction_Reverse, 100);//Bank B 的Motor-1以馬力100轉,機器人將手臂全力往下上舉,把球收今去
delay(300);
nxshield.bank_b.motorStop(SH_Motor_1, SH_Next_Action_BrakeHold);//Bank B 的Motor-1停止鎖死