kevin eccli / Mbed 2 deprecated Freescale_CupV4

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Propulsion.cpp Source File

Propulsion.cpp

00001 #include "Propulsion.h"
00002 
00003 Propulsion::Propulsion() : 
00004     moteurDroit(MOTD1_PIN,MOTD2_PIN,FBD_PIN,MOTD_CAPTEUR1_PIN,MOTD_CAPTEUR2_PIN), 
00005     moteurGauche(MOTG1_PIN,MOTG2_PIN,FBG_PIN,MOTG_CAPTEUR1_PIN,MOTG_CAPTEUR2_PIN)
00006 {
00007     //Lors de leurs instanciations les moeturs ont leur puissance initialisée à 0.
00008 }
00009 
00010 //IMPLEMENTER LE DIFFERENTIEL ICI
00011 void Propulsion::setVitesse(float v)
00012 {
00013     this->moteurDroit.setVitesse(v);
00014     this->moteurGauche.setVitesse(v);
00015 }
00016 
00017 void Propulsion::testPropulsion1()
00018 {
00019     this->moteurDroit.test1();
00020     this->moteurGauche.test1();
00021 }
00022 
00023 void Propulsion::setDKp(float k)
00024 {
00025     this->moteurDroit.setKp(k);
00026 }
00027 
00028 void Propulsion::setDKi(float k)
00029 {
00030     this->moteurDroit.setKi(k);
00031 }
00032 
00033 void Propulsion::setDKd(float k)
00034 {
00035     this->moteurDroit.setKd(k);
00036 }
00037 
00038 void Propulsion::setGKp(float k)
00039 {
00040     this->moteurGauche.setKp(k);
00041 }
00042 
00043 void Propulsion::setGKi(float k)
00044 {
00045     this->moteurGauche.setKi(k);
00046 }
00047 
00048 void Propulsion::setGKd(float k)
00049 {
00050     this->moteurGauche.setKd(k);
00051 }
00052 
00053 
00054 /*
00055 void Propulsion::testPropulsion2()
00056 {
00057     moteurD1.write(1);
00058     wait(1.0f);
00059     moteurG1.write(1);
00060     wait(1.0f);
00061     setPuissanceMoteurs(0.5,0.5);
00062     wait(1.0f);
00063     setPuissanceMoteurs(-0.5,-0.5);
00064     wait(1.0f);
00065     setPuissanceMoteurs(0,-0.5);
00066     wait(1.0f);
00067     setPuissanceMoteurs(0,0);
00068 }
00069 */