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.
autoMode.h
- Committer:
- DeguNaoto
- Date:
- 2015-11-09
- Revision:
- 27:88863fab46c0
- Parent:
- 26:760f1bce8214
- Child:
- 29:460e49e37048
File content as of revision 27:88863fab46c0:
#ifndef AUTOMODE_H #define AUTOMODE_H /***PID Controller***/ PID velocity_controller(9.0,5274.0,0.0,RATE); PID direction_controller(36.0,3.5,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; flagf = 1; } /***IM920 correspondence***/ void autoIM920() { if(b==7){ /*mode change*/ if(edge7) { edge7=0; autoflag=0; Indicator4=0; IndicatorAuto=1; direction_controller.setTunings(12.0,9.0,0.0); targ_velocity=0.0; flaga=0; spcount=speed; dpcount=0.0; } } else if((b==6)&&(!flaga)){ /*start*/ if(edge6){ edge6=0; resetState(); flagf=1; spcount=0.0; dpcount=0.0; direction_controller.setBias(0.0); #ifdef BLUE sendData(5,65); //right wait(0.05); sendData(4,65); //left wait(0.05); // sendData(6,10); //middle stateR = 69; stateL = 69; #else sendData(5,69); //right wait(0.05); sendData(4,69); //left wait(0.05); sendData(6,69); //middle stateR = 69; stateL = 69; #endif step = 0; CStep = 1; flaga = 1; } } /*if(a2){ skip = 1; } else if(!a2){ skip = 0; }*/ skip=0; if(b!=1) edge1=1; if(b!=2) edge2=1; if(b!=3) edge3=1; if(b!=4) edge4=1; if(b!=5) edge5=1; if(b!=6) edge6=1; if(b!=7) edge7=1; if(b!=8) edge8=1; if(b!=9) edge9=1; } #endif /*autoMode.h*/