![](/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
Diff: sample_main.cpp
- Revision:
- 11:e880912260b5
- Parent:
- 10:fe56f6800a72
- Child:
- 12:3949fd23be49
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sample_main.cpp Tue May 25 08:59:55 2021 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "QEI.h" +#include "DC_Motor_Controller.h" + + +DC_Motor_Controller motor(D6,D3,D4,D5,792); //M1, M2, INA, INB, PPR + + + +int sample_main() { + + motor.reset(); + /* + motor.set_out(1,0); + wait(5); + motor.set_out(0,1); + wait(5);*/ + + + motor.move_angle(-90, 0.5); // speed, 0 to 1 + + wait(1.5); + + motor.move_angle(90, 0.3); + wait(1.5); + motor.goto_angle(0, 0.1); +} \ No newline at end of file