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:
- 96:a972ba5cf2d7
- Parent:
- 90:9fe39ebe721f
- Child:
- 97:5e6f513b26f2
diff -r deb2e75c42ff -r a972ba5cf2d7 autoMode.h --- a/autoMode.h Fri Oct 16 06:53:36 2015 +0000 +++ b/autoMode.h Fri Oct 16 07:12:29 2015 +0000 @@ -7,6 +7,15 @@ PID velocity_controller(9.0,5274.0,0.0,RATE); PID direction_controller(36.0,3.0,0.0,RATE); +Timeout OpStart; + +void OpponentsStart(){ + spcount=0.0; + step = 15; + CStep = 15; + flaga = 1; +} + #ifdef IM920 /***IM920 correspondence***/ void autoIM920() { @@ -61,8 +70,6 @@ if(edge8){ edge8=0; resetState(); - flagf = 1; - spcount=0.0; // targ_velocity = speed; // sendData(7,70); sendData(5,69); //right @@ -71,9 +78,11 @@ wait(0.05); stateR = 70; stateL = 70; - step = 15; - CStep = 15; - flaga = 1; + OpStart.attach(&OpponentsStart,5.0); +// spcount=0.0; +// step = 15; +// CStep = 15; +// flaga = 1; } } else if(b==9){ /******/