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.
Diff: machine_ps3.h
- Revision:
- 30:cd344beb415d
- Parent:
- 26:760f1bce8214
- Child:
- 32:b8c8ad2eeca7
diff -r 460e49e37048 -r cd344beb415d machine_ps3.h --- a/machine_ps3.h Tue Nov 10 07:46:00 2015 +0000 +++ b/machine_ps3.h Tue Nov 10 09:42:33 2015 +0000 @@ -162,17 +162,29 @@ } /***The function reset state.***/ -void resetState(){ +void resetState(short d){ #ifdef BLUE x=0.0; y=0.0; - sita=PI/4.0; - targ_sita=PI/4.0; + if(d){ + sita=PI/4.0; + targ_sita=PI/4.0; + } + else{ + sita=-PI/4.0; + targ_sita=-PI/4.0; + } #else x=0.0; y=0.0; - sita=-PI/4.0; - targ_sita=-PI/4.0; + if(d){ + sita=-PI/4.0; + targ_sita=-PI/4.0; + } + else{ + sita=PI/4.0; + targ_sita=PI/4.0; + } #endif targ_velocity=0.0; Move_r_sense.reset(); @@ -181,4 +193,4 @@ direction_controller.reset(); } -#endif /*machine.h*/ +#endif /*machine.h*/ \ No newline at end of file