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
Classes/Deplacement.cpp
- Committer:
- Wael_H
- Date:
- 2019-06-07
- Revision:
- 34:cea05fa02f37
- Parent:
- 27:e103da412e2b
- Child:
- 36:0a6cb92024c7
File content as of revision 34:cea05fa02f37:
#include "Deplacement.h"
#include "CAN_asser.h"
Deplacement::Deplacement()
{
this->peutBouger = true;
}
bool Deplacement::getFlag()
{
return this->peutBouger;
}
short Deplacement::getPos(int i)
{
return this->pos[i];
}
bool Deplacement::avance(signed short dist)
{
if(this->peutBouger)
{
GoStraight(dist,0,0,0);
this->peutBouger = false;
}
else
updateCAN(this->peutBouger, this->pos);
return this->peutBouger;
}
bool Deplacement::tourne(signed short angle)
{
if(this->peutBouger)
{
Rotate(angle);
this->peutBouger = false;
}
else
updateCAN(this->peutBouger, this->pos);
return this->peutBouger;
}
bool Deplacement::GoToXYT(unsigned short x, unsigned short y, signed short t, signed char sens) //sens = 0 par défaut
{
if(this->peutBouger)
{
GoToPosition(y,x,t,sens);
this->peutBouger = false;
}
else
updateCAN(this->peutBouger, this->pos);
return this->peutBouger;
}
void Deplacement::stop()
{
SendRawId(ASSERVISSEMENT_STOP);
do updateCAN(this->peutBouger, this->pos);
while(!this->peutBouger);
}
bool Deplacement::immobile()
{
return this->peutBouger;
}