![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Signa-bot code for project BioRobotics, at University of Twente.
Dependencies: mbed QEI MODSERIAL FastPWM ttmath Math
Diff: Motor_tryout.cpp
- Revision:
- 14:b813ddfbcd71
- Parent:
- 13:18dd7a15603f
- Child:
- 16:2ad161f709f6
diff -r 18dd7a15603f -r b813ddfbcd71 Motor_tryout.cpp --- a/Motor_tryout.cpp Mon Oct 07 12:40:19 2019 +0000 +++ b/Motor_tryout.cpp Mon Oct 07 13:56:24 2019 +0000 @@ -7,11 +7,15 @@ DigitalOut motor1_dir(PTC3); // richting motor 1 DigitalOut motor2_pwm(PTA2); // aansturen motor 2, via poort PTA2 DigitalOut motor2_dir(PTB23); // richting motor 2 +DigitalOut motor3_pwm(PTA0); // aansturen motor 3, via poort PTA2 +DigitalOut motor3_dir(PTC4); // richting motor 3 DigitalIn motor1_1(PTD1); // data vanuit motor 1 DigitalIn motor1_2(PTD3); // data vanuit motor 1 AnalogIn input(PTB3); // input van ECG MODSERIAL pc(USBTX, USBRX); -QEI Encoder(D12,D13,NC,64,QEI::X4_ENCODING); +\\QEI Encoder(D12,D13,NC,64,QEI::X4_ENCODING); +\\QEI Encoder(D12,D13,NC,64,QEI::X4_ENCODING); +QEI Encoder(D2,D3,NC,64,QEI::X4_ENCODING); // Global variables int quit; @@ -51,7 +55,7 @@ while(cc == 'g') { int frequency_pwm = 10000; //10 kHz PWM - PwmOut motor1_pwm(PTC2); + PwmOut motor3_pwm(PTC2); PwmOut motor2_pwm(PTA2); motor1_pwm.period(1.0/(double)frequency_pwm); // T=1/f motor1_dir.write(0); // positief