Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 */
Generated on Wed Jul 13 2022 20:35:19 by
1.7.2