Library version for DC_Stepper_Controller_Lib with PWM speed control
Dependents: DR-ArmServoTest Auto_DC_pick_class MBed_TR1 ros_button_2021
Diff: main.cpp
- Revision:
- 7:6e59ed00a6a9
- Parent:
- 5:c040faf21e07
- Child:
- 8:703502486434
--- a/main.cpp Wed May 19 08:26:34 2021 +0000 +++ b/main.cpp Mon May 24 08:17:09 2021 +0000 @@ -2,15 +2,26 @@ #include "QEI.h" #include "DC_Motor_Controller.h" -DC_Motor_Controller motor(D2,D4,D8,D7,792); +DC_Motor_Controller motor(D2,D3,D4,D5,792); //out1 out2 in1 in2 ppr +// D4 -> INA +// D5 -> INB +// D3 -> IN2 -> M1 +// D2 -> IN1 -> M2 + - -int main() { // Sample Testing program +int main() { + motor.reset(); - motor.move_angle(90); - wait(1); - motor.move_angle(-90); - wait(1); - motor.move_angle(-90); - wait(1); + /* + motor.set_out(1,0); + wait(5); + motor.set_out(0,1); + wait(5);*/ + + + motor.move_angle(-180); + + wait(3); + + motor.reset(); } \ No newline at end of file