a
Dependencies: Locate Move Servo button mbed
Fork of 4thcomp by
Diff: main.cpp
- Revision:
- 14:0629ab54765c
- Parent:
- 12:456d651ef4f0
- Child:
- 15:a2cdcb373d3d
diff -r 755158678c8a -r 0629ab54765c main.cpp --- a/main.cpp Thu Sep 08 02:11:22 2016 +0000 +++ b/main.cpp Thu Sep 08 10:08:17 2016 +0000 @@ -6,15 +6,66 @@ #include "button.h" - int main() { + int team=1; setup(); initmotor(); - while(1){ - armdegree(12*phaseSW()); - handdegree(12*phaseSW()); - beltdegree(12*phaseSW()); - } + int targetx[9] = { 600,600,600,1200,900,1200,900,1200,900 }; + int targety[9] = { team*300,team*600,team*900,team*1200,team*900,team*600,team*600,0,team*300 }; + int goalx=0,goaly1=1200,goaly2=900,goaly3=600,goaly4=300; + +//オブジェクト0,1,2回収 + pmove(targetx[0],0); + pmove(targetx[0],targety[0]); + //回収 + pmove(targetx[1],targety[1]); + //回収 + pmove(targetx[2],targety[2]); + //回収 + + pmove(600,1200);//次につなげるハブ + + pmove(goalx,goaly1); + //リリース + back300();//(300,1200)なう + /****************/ + + //オブジェクト3,4回収 + pmove(targetx[3],targety[3]); + //回収 + pmove(1200,900);//ハブ + pmove(targetx[4],targety[4]); + //回収? + pmove(goalx,goaly2); + //リリース + back300(); + /***************/ + + //オブジェクト5,6回収 + pmove(1200,900);//ハブ + pmove(targetx[5],targety[5]); + //回収 + pmove(targetx[6],targety[6]); + //回収? + pmove(goalx,goaly3); + //リリース + back300(); + /**********************/ + + //オブジェクト7,8回収 + pmove(300,0);//ハブ + pmove(targetx[7],targety[7]); + //回収 + pmove(1200,300);//ハブ + pmove(targetx[8],targety[8]); + //回収? + pmove(goalx,goaly4); + //リリース + back300(); + /**********************/ + + + }