working PID + Kinematics + Motorcontrol
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Diff: main.cpp
- Revision:
- 4:85770b268599
- Parent:
- 2:44758d95cb0b
- Child:
- 5:a54ea6514bc5
--- a/main.cpp Wed Oct 31 15:08:58 2018 +0000 +++ b/main.cpp Wed Oct 31 16:00:45 2018 +0000 @@ -19,10 +19,14 @@ // PID CONTROLLER -- PIN DEFENITIONS AnalogIn button2(A4); AnalogIn button1(A3); + DigitalOut directionpin1(D7); // motor 1 +DigitalOut directionpin2(D4); // motor 2 PwmOut pwmpin1(D6); // motor 1 +PwmOut pwmpin2(D5); // motor 2 QEI encoder1 (D9, D8, NC, 8400, QEI::X4_ENCODING); +QEI encoder2 (D11, D10, NC, 8400, QEI::X4_ENCODING); // motor 2 MODSERIAL pc(USBTX, USBRX); HIDScope scope(2); @@ -253,8 +257,8 @@ // Tickers //show_counts.attach(PrintFlag, 0.2); - ref_rot.attach(Motor_mover, 0.01); - Scope_Data.attach(ScopeData, 0.01); + ref_rot.attach(Motor_mover, 0.1); + //Scope_Data.attach(ScopeData, 0.01); while(true){