![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Library version for DC_Stepper_Controller_Lib with PWM speed control
Dependents: DR-ArmServoTest Auto_DC_pick_class MBed_TR1 ros_button_2021
DC_Motor_Controller.h
- Committer:
- stivending
- Date:
- 2021-05-25
- Revision:
- 9:49b59b308767
- Parent:
- 8:703502486434
- Child:
- 10:fe56f6800a72
File content as of revision 9:49b59b308767:
#include "mbed.h" #include "QEI.h" #include <cmath> #ifndef DC_MOTOR_CONTROLLER_H #define DC_MOTOR_CONTROLLER_H class DC_Motor_Controller { private: DigitalOut out1, out2; QEI dc_motor; public: DC_Motor_Controller(PinName out_M1, PinName out_M2, PinName in_A, PinName in_B, int PPR) : out1(out_M1), out2(out_M2), dc_motor(in_A, in_B, NC, PPR){} void goto_angle(int angle); void reset(); void move_angle(int angle); void set_out(int a, int b); int get_pulse(); }; #endif