Motor class working

Dependencies:   QEI biquadFilter mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Motor.h Source File

Motor.h

00001 #ifndef MOTOR_H
00002 #define MOTOR_H
00003 
00004 #include "mbed.h"
00005 #include "QEI.h"
00006 #include "iostream"
00007 class Motor {
00008   private:
00009     float velocity ; // acual velocity of motor in degrees/s
00010     float angle ;    // angle of the motor in degrees
00011     float frequency ;
00012     float sample_time;   // set sample time of  motor 
00013     float angle_prev;
00014     float safety_angle; //safety angle in degrees
00015     int POS , NEG;
00016     QEI _Encoder;
00017     DigitalOut _direction;
00018     PwmOut _PWM;
00019     
00020     
00021   public:
00022     Motor();
00023     Motor(float , PinName , PinName , PinName , PinName , PinName , int , float , int , float , float , int);
00024     void change_direction();
00025     void control_velocity(float);
00026     void set_period(float);
00027     void set_angle();               //needs to be updated 
00028     void set_velocity();            //needs to be updated
00029     
00030     float get_velocity();
00031     float get_period();
00032     
00033     
00034 };
00035 
00036 #endif