Ironcup Mar 2020

Dependencies:   mbed mbed-rtos MotionSensor EthernetInterface

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Motor.h Source File

Motor.h

00001 #ifndef MOTOR_HEADER
00002 #define MOTOR_HEADER
00003 
00004 #include "mbed.h"
00005 #include "CarPWM.h"
00006 
00007 class Motor{
00008     
00009     protected:
00010     Ticker interruption;
00011     bool alternate_motor;
00012     float velocity;
00013     float jog_duty_cycle;
00014     float jog_period;
00015     PwmOut motor;
00016 
00017 public:
00018     
00019     void startJogging(float jog_dc, float jog_p);
00020     void stopJogging(void);
00021     void brakeMotor(float brake_intensity, float brake_wait);
00022     void reverseMotor(int speed);
00023     void setVelocity(int new_velocity);
00024     float getVelocity();
00025     void setSmoothVelocity(int new_velocity);
00026     Motor(): motor(PTC3){}
00027     
00028 private:
00029      void motorJogging(void);
00030      
00031 };
00032 #endif