Florian Fillol / Moteur

Fork of Motor by Simon Ford

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Moteur.h Source File

Moteur.h

00001 #ifndef MOTOR_H
00002 #define MOTOR_H
00003 
00004 #include "mbed.h"
00005 
00006 
00007 class Moteur {
00008 public:
00009 
00010     /** Create a motor control interface    
00011      *
00012      * @param pwm A PwmOut pin, driving the H-bridge enable line to control the speed
00013      * @param fwd A DigitalOut, set high when the motor should go forward
00014      * @param rev A DigitalOut, set high when the motor should go backwards
00015      */
00016     Moteur(PinName pwm, PinName avancer, PinName reculer);
00017     void vitesse(float vit); /*@param speed The speed of the motor as a normalised value between -1.0 and 1.0*/
00018 
00019 protected:
00020     PwmOut _pwm;
00021     DigitalOut _avancer;
00022     DigitalOut _reculer;
00023 };
00024 
00025 #endif