![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
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:
- 4:f74c981d9bc0
- Parent:
- 3:99a568200720
- Child:
- 5:d396168a1b20
diff -r 99a568200720 -r f74c981d9bc0 main.cpp --- a/main.cpp Tue Sep 12 15:07:38 2017 +0000 +++ b/main.cpp Tue Sep 12 15:15:24 2017 +0000 @@ -14,11 +14,37 @@ ledR = true; ledB = true; + ledG = true; while (true) { int keyPress = pc.getc(); pc.putc(keyPress); - ledG = !ledG; // toggle a led + pc.printf("%i", keyPress); + + if(keyPress == 114) + { + ledG = true; + ledB = true; + ledR = !ledR; + } + else if(keyPress == 103) + { + ledR = true; + ledB = true; + ledG = !ledG; + } + else if(keyPress == 98) + { + ledR = true; + ledG = true; + ledB = !ledB; + } + else + { + ledG = true; + ledB = true; + ledR = true; + } } }