deplacement v6

Fork of Deplacement by Projet robot

Committer:
aure
Date:
Thu Feb 02 10:21:55 2017 +0000
Revision:
1:662d3c47637f
Parent:
0:d6b2da5ef6cb
Child:
2:7e0d789e1be8
k

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aure 0:d6b2da5ef6cb 1 #include "Deplacement.h"
aure 1:662d3c47637f 2 #include "mbed.h"
aure 0:d6b2da5ef6cb 3
aure 0:d6b2da5ef6cb 4
aure 1:662d3c47637f 5 Deplacement::Deplacement() //constructeur
aure 1:662d3c47637f 6 {
aure 1:662d3c47637f 7 posx=0;
aure 1:662d3c47637f 8 posy=0;
aure 1:662d3c47637f 9 this->vitesse=0; //pointeur this
aure 1:662d3c47637f 10 }
aure 1:662d3c47637f 11
aure 1:662d3c47637f 12 Deplacement::~Deplacement()
aure 0:d6b2da5ef6cb 13 {
aure 0:d6b2da5ef6cb 14
aure 1:662d3c47637f 15 }
aure 1:662d3c47637f 16
aure 1:662d3c47637f 17 /////////////////////////////////////////////////////
aure 1:662d3c47637f 18
aure 1:662d3c47637f 19 void Deplacement::setVitesse(float v)
aure 1:662d3c47637f 20 {
aure 1:662d3c47637f 21 this->vitesse=v;
aure 1:662d3c47637f 22 }
aure 1:662d3c47637f 23
aure 1:662d3c47637f 24 /////////////////////////////////////////////////////
aure 1:662d3c47637f 25
aure 1:662d3c47637f 26 void Deplacement::tourner_droite()
aure 1:662d3c47637f 27 {
aure 1:662d3c47637f 28 m3pi.right(this->vitesse);
aure 1:662d3c47637f 29 }
aure 1:662d3c47637f 30
aure 1:662d3c47637f 31 void Deplacement::tourner_gauche()
aure 1:662d3c47637f 32 {
aure 1:662d3c47637f 33 m3pi.left(this->vitesse);
aure 1:662d3c47637f 34 }
aure 1:662d3c47637f 35
aure 1:662d3c47637f 36 void Deplacement::avancer()
aure 1:662d3c47637f 37 {
aure 1:662d3c47637f 38 m3pi.forward(this->vitesse);
aure 1:662d3c47637f 39 }
aure 1:662d3c47637f 40
aure 1:662d3c47637f 41 void Deplacement::reculer()
aure 1:662d3c47637f 42 {
aure 1:662d3c47637f 43 m3pi.backward(this->vitesse);
aure 1:662d3c47637f 44 }
aure 1:662d3c47637f 45
aure 1:662d3c47637f 46
aure 1:662d3c47637f 47
aure 1:662d3c47637f 48
aure 1:662d3c47637f 49
aure 1:662d3c47637f 50
aure 1:662d3c47637f 51