Library version for DC_Stepper_Controller_Lib with PWM speed control

Dependencies:   mbed QEI PID

Dependents:   DR-ArmServoTest Auto_DC_pick_class MBed_TR1 ros_button_2021

Committer:
stivending
Date:
Tue May 25 07:24:10 2021 +0000
Revision:
10:fe56f6800a72
Parent:
9:49b59b308767
pwm speed control added, 0.0 to 1.0;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cheukming0607 2:6bc435f4ffec 1 #include "mbed.h"
aberk 0:bcff39fac858 2 #include "QEI.h"
stivending 5:c040faf21e07 3 #include "DC_Motor_Controller.h"
aberk 0:bcff39fac858 4
stivending 9:49b59b308767 5
stivending 10:fe56f6800a72 6 DC_Motor_Controller motor(D6,D3,D4,D5,792); //M1, M2, INA, INB, PPR
stivending 4:b242191ed0cf 7
stivending 9:49b59b308767 8
stivending 9:49b59b308767 9
stivending 7:6e59ed00a6a9 10 int main() {
stivending 9:49b59b308767 11
stivending 5:c040faf21e07 12 motor.reset();
stivending 7:6e59ed00a6a9 13 /*
stivending 7:6e59ed00a6a9 14 motor.set_out(1,0);
stivending 7:6e59ed00a6a9 15 wait(5);
stivending 7:6e59ed00a6a9 16 motor.set_out(0,1);
stivending 7:6e59ed00a6a9 17 wait(5);*/
stivending 7:6e59ed00a6a9 18
stivending 7:6e59ed00a6a9 19
stivending 10:fe56f6800a72 20 motor.move_angle(-90, 0.5); // speed, 0 to 1
stivending 10:fe56f6800a72 21
stivending 10:fe56f6800a72 22 wait(1.5);
stivending 7:6e59ed00a6a9 23
stivending 10:fe56f6800a72 24 motor.move_angle(90, 0.3);
stivending 10:fe56f6800a72 25 wait(1.5);
stivending 10:fe56f6800a72 26 motor.goto_angle(0, 0.1);
cheukming0607 2:6bc435f4ffec 27 }