Control up to two motors using filtered EMG signals and a PID controller
Dependencies: FastPWM HIDScope MODSERIAL QEI Matrix biquadFilter controller errorFetch mbed motorConfig refGen MatrixMath inverseKinematics
Fork of Minor_test_serial by
Diff: main.cpp
- Revision:
- 3:99a568200720
- Parent:
- 2:002f6b69ebaf
- Child:
- 4:f74c981d9bc0
- Child:
- 6:5f433011819f
--- a/main.cpp Tue Sep 12 15:00:09 2017 +0000 +++ b/main.cpp Tue Sep 12 15:07:38 2017 +0000 @@ -1,7 +1,9 @@ #include "mbed.h" #include "MODSERIAL.h" -DigitalOut myled(LED_GREEN); +DigitalOut ledG(LED_GREEN); +DigitalOut ledR(LED_RED); +DigitalOut ledB(LED_BLUE); MODSERIAL pc(USBTX, USBRX); int main() @@ -10,9 +12,13 @@ pc.baud(115200); pc.printf("Hello World!\r\n"); + ledR = true; + ledB = true; + while (true) { - pc.putc(pc.getc()); - myled = !myled; // toggle a led + int keyPress = pc.getc(); + pc.putc(keyPress); + ledG = !ledG; // toggle a led } }