deplacement v6
Fork of Deplacement by
Deplacement.cpp
- Committer:
- aure
- Date:
- 2017-02-02
- Revision:
- 3:965871a8c5ff
- Parent:
- 2:7e0d789e1be8
- Child:
- 4:bd8b50f91f81
File content as of revision 3:965871a8c5ff:
#include "Deplacement.h" #include "mbed.h" Deplacement::Deplacement() //constructeur { posx=0; posy=0; this->vitesse=0; //pointeur this } Deplacement::~Deplacement() { } ///////////////////////////////////////////////////// void Deplacement::setVitesse(float v) { this->vitesse=v; } ///////////////////////////////////////////////////// void Deplacement::tourner_droite() { int copie=0; m3pi.right(this->vitesse); posx=copie; posx=posy; posy=-copie; } void Deplacement::tourner_gauche() { int copie=0; m3pi.left(this->vitesse); posx=copie; posx=-posy; posy=copie; } void Deplacement::avancer() { m3pi.forward(this->vitesse); posy++; } void Deplacement::reculer() { m3pi.backward(this->vitesse); posy--; } void Deplacement::stop() { m3pi.stop(); } void Deplacement::RAZ() { posx=0; posy=0; this->vitesse=0; } float Deplacement::getVitesse() {return(this->vitesse); } int Deplacement::getPosX() { return(this->posx); } int Deplacement::getPosY() { return(this->posy); }