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.
Dependencies: mbed
Diff: Classes/Deplacement.cpp
- Revision:
- 10:efa507ba2b35
- Child:
- 13:9c62e263f245
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Classes/Deplacement.cpp Thu May 23 21:26:08 2019 +0000 @@ -0,0 +1,46 @@ +#include "Deplacement.h" +#include "CAN_asser.h" + +Deplacement::Deplacement() +{ + this->peutBouger = true; +} + +bool Deplacement::avance(int dist) +{ + if(this->peutBouger) + { + GoStraight(dist,0,0,0); + this->peutBouger = false; + } + else + majFlagDpl(this->peutBouger); + + return this->peutBouger; +} + +bool Deplacement::tourne(int angle) +{ + if(this->peutBouger) + { + Rotate(angle); + this->peutBouger = false; + } + else + majFlagDpl(this->peutBouger); + + return this->peutBouger; +} + +bool Deplacement::GoToXYT(int x, int y, int t, int sens) //sens = 0 par défaut +{ + if(this->peutBouger) + { + GoToPosition(x,y,t,sens); + this->peutBouger = false; + } + else + majFlagDpl(this->peutBouger); + + return this->peutBouger; +} \ No newline at end of file