[[2004/C4/ロボコン]]

#include "spy.nqh"
#define TURN_TIME 107
#define go_straight(t)OnRev(OUT_A+OUT_B);Wait(t);Off(OUT_A+OUT_B);
#define go_buck(t)OnFwd(OUT_A+OUT_B);Wait(t);Off(OUT_A+OUT_B);



sub turn_left()
{ 
 OnRev(OUT_A);OnFwd(OUT_B);Wait(TURN_TIME);
 Off(OUT_A+OUT_B);
}



task main()
{
 go_straight(175)  //落下
 OnFwd(OUT_A);OnRev(OUT_B);Wait(100);  //右に曲がる
 go_straight(250);   //クレーン前を直進
 go_straight(225);   //クレーン前を直進
 turn_left();  //左に曲がる
 go_straight(550);   //直進
 go_straight(540);   //直進
 turn_left();
 go_straight(150);  //相手前を直進 
 go_straight(100);  //相手前を直進 
 turn_left();
 go_straight(400);  //箱を押す
 go_buck(470);     //箱を置いて後退
 go_buck(450);     //箱を置いて後退
 turn_left();
 go_buck(320);

 while(true)
 {
  go_straight(210);
  go_buck(210);
  }
}

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS