Refactoring Ironcup 2020
Dependencies: mbed mbed-rtos MotionSensor EthernetInterface
Motor/Motor.hpp
- Committer:
- starling
- Date:
- 2020-09-21
- Revision:
- 0:8f5db5085df7
File content as of revision 0:8f5db5085df7:
#ifndef MOTOR_HEADER #define MOTOR_HEADER #include "mbed.h" #include "CarPWM.h" class Motor{ protected: Ticker interruption; bool alternate_motor; float velocity; float jog_duty_cycle; float jog_period; PwmOut motor; public: void startJogging(float jog_dc, float jog_p); void stopJogging(void); void brakeMotor(float brake_intensity, float brake_wait); void reverseMotor(int speed); void setVelocity(int new_velocity); float getVelocity(); void setSmoothVelocity(int new_velocity); Motor(PinName motor_pin); private: void motorJogging(void); }; #endif