![](/media/cache/group/9e3cc099b3b04bca937a1cca1da81b19.jpg.50x50_q85.jpg)
Afgesplitste versie van motor control waarbij we ook iets met EMG gaan doen
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 6:c352578a95b3
- Parent:
- 5:54ce02ad7a50
- Child:
- 7:9125918ca8c5
diff -r 54ce02ad7a50 -r c352578a95b3 main.cpp --- a/main.cpp Fri Oct 04 13:24:06 2019 +0000 +++ b/main.cpp Mon Oct 07 07:28:56 2019 +0000 @@ -5,24 +5,26 @@ //#include "BiQuad.h" #include "FastPWM.h" -DigitalOut ledr(LED_RED); -DigitalOut ledg(LED_GREEN); -DigitalOut ledb(LED_BLUE); -PwmOut led1(D10); +// Button and potmeter control InterruptIn button1(D11); InterruptIn button2(D10); AnalogIn potmeter(A0); -DigitalIn sw(SW2); -MODSERIAL pc(USBTX, USBRX); + +// Encoder DigitalIn encA(D13); DigitalIn encB(D12); QEI encoder(D13,D12,NC,64,QEI::X4_ENCODING); +// Motor DigitalOut motor2Direction(D4); FastPWM motor2Power(D5); DigitalOut motor1Direction(D7); FastPWM motor1Power(D6); +// PC connection +MODSERIAL pc(USBTX, USBRX); + +// Intializing tickers Ticker motorTicker; Ticker encoderTicker;