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.
Diff: Base/Asservissement.h
- Revision:
- 0:1cfd66c3a181
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Base/Asservissement.h Wed May 22 16:54:27 2019 +0000 @@ -0,0 +1,39 @@ +#ifndef ASSERVISSEMENT_H +#define ASSERVISSEMENT_H + +#include "mbed.h" + +class Asservissement { + public: + // Constructeur: + Asservissement(float P, float I, float D); + + // Setters: + void setP(float P); + void setI(float I); + void setD(float D); + void setPID(float P, float I, float D); + + // Pointeurs: + float* getP_ptr(); + float* getI_ptr(); + float* getD_ptr(); + + // Asservissement: + void toValue(float value); + + // Calcul d'asservissement: + float computeError(float value); + + private: + // PID: + float m_P, m_I, m_D; + + // Value: + float m_desired_value; + + float m_erreur_prev, m_erreur_integral; + +}; + +#endif \ No newline at end of file