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: Actionneurs/Moteur.h
- Revision:
- 0:1cfd66c3a181
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Actionneurs/Moteur.h Wed May 22 16:54:27 2019 +0000 @@ -0,0 +1,33 @@ +#ifndef MOTEUR_H +#define MOTEUR_H + +#include "mbed.h" + +class Moteur { + public: + // Constructeur: + Moteur(PinName pin_en, PinName pin_in1, PinName pin_in2); + + // Déplacement: + void forward(); + void backward(); + void opposite(); + void stop(); + void turn(float pwm); + + // Setter: + void setPWM(float pwm); // entre 0 et 1 + void setPWM_max(float pwm); // entre 0 et 1 + void setOffset(float offset); // entre 0 et 1 + + private: + PwmOut m_pwm; + DigitalOut m_in1; + DigitalOut m_in2; + + float m_pwm_max; + float m_offset; + +}; + +#endif \ No newline at end of file