pattern v3

Fork of PATTERN by Projet robot

Committer:
fab16
Date:
Thu Mar 02 12:37:43 2017 +0000
Revision:
0:42a271a32851
Child:
1:601c2fa986bf
pattern v1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fab16 0:42a271a32851 1 #include "Pattern.h"
fab16 0:42a271a32851 2 #include "mbed.h"
fab16 0:42a271a32851 3
fab16 0:42a271a32851 4 m3pi m3piP;
fab16 0:42a271a32851 5
fab16 0:42a271a32851 6 Pattern::Pattern(){
fab16 0:42a271a32851 7 this->vitesse=0.1;
fab16 0:42a271a32851 8 }
fab16 0:42a271a32851 9
fab16 0:42a271a32851 10 Pattern::~Pattern(){
fab16 0:42a271a32851 11
fab16 0:42a271a32851 12 }
fab16 0:42a271a32851 13
fab16 0:42a271a32851 14
fab16 0:42a271a32851 15 void Pattern::carre(){
fab16 0:42a271a32851 16
fab16 0:42a271a32851 17 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 18 wait(2);
fab16 0:42a271a32851 19 m3piP.right(this->vitesse);
fab16 0:42a271a32851 20 wait(0.9);
fab16 0:42a271a32851 21
fab16 0:42a271a32851 22 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 23 wait(2);
fab16 0:42a271a32851 24 m3piP.right(this->vitesse);
fab16 0:42a271a32851 25 wait(0.9);
fab16 0:42a271a32851 26
fab16 0:42a271a32851 27 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 28 wait(2);
fab16 0:42a271a32851 29 m3piP.right(this->vitesse);
fab16 0:42a271a32851 30 wait(0.9);
fab16 0:42a271a32851 31
fab16 0:42a271a32851 32 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 33 wait(2);
fab16 0:42a271a32851 34 m3piP.right(this->vitesse);
fab16 0:42a271a32851 35 wait(0.9);
fab16 0:42a271a32851 36
fab16 0:42a271a32851 37 m3piP.stop();
fab16 0:42a271a32851 38
fab16 0:42a271a32851 39 }
fab16 0:42a271a32851 40
fab16 0:42a271a32851 41 void Pattern::triangle(){
fab16 0:42a271a32851 42
fab16 0:42a271a32851 43 m3piP.right(this->vitesse);
fab16 0:42a271a32851 44 wait(0.3);
fab16 0:42a271a32851 45
fab16 0:42a271a32851 46 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 47 wait(2);
fab16 0:42a271a32851 48 m3piP.right(this->vitesse);
fab16 0:42a271a32851 49 wait(1.2);
fab16 0:42a271a32851 50
fab16 0:42a271a32851 51 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 52 wait(2);
fab16 0:42a271a32851 53 m3piP.right(this->vitesse);
fab16 0:42a271a32851 54 wait(1.2);
fab16 0:42a271a32851 55
fab16 0:42a271a32851 56 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 57 wait(2);
fab16 0:42a271a32851 58 m3piP.right(this->vitesse);
fab16 0:42a271a32851 59 wait(0.9);
fab16 0:42a271a32851 60
fab16 0:42a271a32851 61 m3piP.stop();
fab16 0:42a271a32851 62
fab16 0:42a271a32851 63 }
fab16 0:42a271a32851 64
fab16 0:42a271a32851 65
fab16 0:42a271a32851 66 void Pattern::etoile(){
fab16 0:42a271a32851 67
fab16 0:42a271a32851 68 m3piP.left(this->vitesse);
fab16 0:42a271a32851 69 wait(0.3);
fab16 0:42a271a32851 70 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 71 wait(2);
fab16 0:42a271a32851 72 m3piP.left(this->vitesse);
fab16 0:42a271a32851 73 wait(0.3);
fab16 0:42a271a32851 74 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 75 wait(2);
fab16 0:42a271a32851 76 m3piP.right(this->vitesse);
fab16 0:42a271a32851 77 wait(0.9);
fab16 0:42a271a32851 78 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 79 wait(2);
fab16 0:42a271a32851 80 m3piP.left(this->vitesse);
fab16 0:42a271a32851 81 wait(0.3);
fab16 0:42a271a32851 82 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 83 wait(2);
fab16 0:42a271a32851 84 m3piP.right(this->vitesse);
fab16 0:42a271a32851 85 wait(1.5);
fab16 0:42a271a32851 86 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 87 wait(2);
fab16 0:42a271a32851 88 m3piP.left(this->vitesse);
fab16 0:42a271a32851 89 wait(0.3);
fab16 0:42a271a32851 90 m3piP.forward(this->vitesse);
fab16 0:42a271a32851 91 wait(2);
fab16 0:42a271a32851 92 //150
fab16 0:42a271a32851 93
fab16 0:42a271a32851 94
fab16 0:42a271a32851 95
fab16 0:42a271a32851 96
fab16 0:42a271a32851 97
fab16 0:42a271a32851 98 m3piP.stop();
fab16 0:42a271a32851 99 }