a
Dependencies: Locate Move Servo button mbed
Fork of 3rdcompfixstart by
Diff: main.cpp
- Revision:
- 16:a9885a66048f
- Parent:
- 15:a2cdcb373d3d
- Child:
- 17:5b9fbb6133ad
diff -r a2cdcb373d3d -r a9885a66048f main.cpp --- a/main.cpp Fri Sep 09 05:41:41 2016 +0000 +++ b/main.cpp Fri Sep 09 11:41:27 2016 +0000 @@ -5,6 +5,11 @@ #include "servo.h" #include "button.h" +DigitalOut ledg(PC_2); //green +DigitalOut ledy(PC_3); //yellow +DigitalOut ledr(PC_0); //red + + const int dist=30; const int slidedist=150; const int space=100; @@ -19,11 +24,25 @@ int targety[9] = { team*(300+slidedist),team*(600+slidedist),team*(900+slidedist),team*(1200+slidedist),team*(900+slidedist),team*(600+slidedist),team*(600+slidedist),team*(0+slidedist),team*(300+slidedist) }; int goalx=0,goaly1=1200+150,goaly2=900+slidedist,goaly3=600+slidedist,goaly4=300+slidedist; + + //オブジェクト0,1,2回収 + pmove(targetx[0],0); + open_hand(); pmove(targetx[0],targety[0]); + close_hand(); + beltup(); + wait(5); + beltstop(); + open_hand(); //回収 pmove(targetx[1],targety[1]); + close_hand(); + beltup(); + wait(5); + beltstop(); + open_hand(); //回収 pmove(targetx[2],targety[2]); //回収