deplacement v6

Fork of Deplacement by Projet robot

Deplacement.cpp

Committer:
aure
Date:
2017-02-02
Revision:
1:662d3c47637f
Parent:
0:d6b2da5ef6cb
Child:
2:7e0d789e1be8

File content as of revision 1:662d3c47637f:

#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()
{
    m3pi.right(this->vitesse);
}
    
void Deplacement::tourner_gauche()
{
    m3pi.left(this->vitesse);
}

void Deplacement::avancer()
{
    m3pi.forward(this->vitesse);
}

void Deplacement::reculer()
{
    m3pi.backward(this->vitesse);
}