pattern v3
Fork of PATTERN by
Pattern.cpp
- Committer:
- fab16
- Date:
- 2017-03-02
- Revision:
- 0:42a271a32851
- Child:
- 1:601c2fa986bf
File content as of revision 0:42a271a32851:
#include "Pattern.h" #include "mbed.h" m3pi m3piP; Pattern::Pattern(){ this->vitesse=0.1; } Pattern::~Pattern(){ } void Pattern::carre(){ m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(0.9); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(0.9); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(0.9); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(0.9); m3piP.stop(); } void Pattern::triangle(){ m3piP.right(this->vitesse); wait(0.3); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(1.2); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(1.2); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(0.9); m3piP.stop(); } void Pattern::etoile(){ m3piP.left(this->vitesse); wait(0.3); m3piP.forward(this->vitesse); wait(2); m3piP.left(this->vitesse); wait(0.3); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(0.9); m3piP.forward(this->vitesse); wait(2); m3piP.left(this->vitesse); wait(0.3); m3piP.forward(this->vitesse); wait(2); m3piP.right(this->vitesse); wait(1.5); m3piP.forward(this->vitesse); wait(2); m3piP.left(this->vitesse); wait(0.3); m3piP.forward(this->vitesse); wait(2); //150 m3piP.stop(); }