Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of 2015robot_main by
Diff: autoMode.h
- Revision:
- 28:c6ed6fb95795
- Parent:
- 26:8e6c736b6791
- Child:
- 29:03bb1ddbe456
diff -r 8e6c736b6791 -r c6ed6fb95795 autoMode.h --- a/autoMode.h Fri Sep 18 04:00:33 2015 +0000 +++ b/autoMode.h Fri Sep 18 06:40:32 2015 +0000 @@ -7,57 +7,30 @@ /***Ps3 correspondence***/ void autoPs3(){ - /*if(up) targ_velocity=speed; + if(up) targ_velocity=speed; else if(down) targ_velocity=-speed; else if(right) targ_velocity=0.0,targ_sita=0.0; else if(left) targ_velocity=0.0,targ_sita=PI/2.0; - else if(r1) targ_sita=0.0; - else if(l1) targ_sita=PI/2.0; - else if(square) if(edge_square) edge_square=0,autoflag=0,Indicator4=0; + else if(r1) sendData(1,1); + else if(l1) sendData(1,2); + else if(square){ + if(edge_square) edge_square=0,autoflag=0,Indicator4=0; + } else if(cross){ - sendData(1, 4); sita=PI/4.0,x=0.0,y=0.0; targ_velocity=0.0; targ_sita=PI/4.0; velocity_controller.reset(); direction_controller.reset(); - wait(0.3); - sita=PI/4.0,x=0.0,y=0.0; - velocity_controller.reset(); - direction_controller.reset(); } - else if(r2){ - if(edge_r1){ - edge_r1=0; - sendData(1, 1); - wait(0.1); - sendData(1, 4); - wait(0.01); - sendData(1, 2); - wait(0.1); - sendData(1, 4); + else if(triangle==1){ + if(edge_triangle){ + edge_triangle=0; + if(cylinderStep==3) cylinderStep=0; + cylinderStep++; + sendData(1, cylinderStep); } } - else if(l2){ - if(edge_l1){ - edge_l1=0; - sendData(1, 3); - wait(0.1); - sendData(1, 4); - wait(0.01); - sendData(1, 5); - wait(0.1); - sendData(1, 7); - } - } - else if(triangle){ - if(edge_triangle){ - edge_triangle=0; - if(cylinder_step==3) cylinder_step=0; - cylinder_step++; - sendData(1, cylinder_step); - } - }*/ }