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.
Moteur.h
00001 #ifndef _MOTEUR_H 00002 #define _MOTEUR_H 00003 00004 #include "mbed.h" 00005 #include "Serie.h" 00006 #include "Pid.h" 00007 00008 00009 class Moteur 00010 { 00011 public: 00012 Moteur(PinName pin_pwm1, PinName pin_pwm2, PinName pin_feedback, PinName pin_capteur1, PinName pin_capteur2); 00013 void setVitesse(int v); 00014 void setKp(float k); 00015 void setKi(float k); 00016 void setKd(float k); 00017 void etalonnage(); 00018 void test1(); 00019 void test2(); 00020 00021 00022 void setVitesse(float v); 00023 float getMesure(); 00024 00025 protected: 00026 void setPuissance(float p); 00027 void asserv(); 00028 void majErreur(); 00029 void interruptCapteurRise(); 00030 void interruptCapteurFall(); 00031 void mesure(); 00032 00033 //IN-OUT 00034 AnalogIn feedbackCurrent; 00035 PwmOut m1; 00036 PwmOut m2; 00037 InterruptIn capteur1; 00038 DigitalIn capteur2; 00039 00040 //MESURE 00041 Timer tmr; 00042 float derniere_mesure; 00043 00044 //REGULATION 00045 Pid regulateur; 00046 Erreur erreur; 00047 float vitesse_consigne; 00048 }; 00049 00050 #endif
Generated on Wed Jul 13 2022 20:35:19 by
1.7.2