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
main.cpp
- Committer:
- tvlogman
- Date:
- 2017-09-13
- Revision:
- 5:d396168a1b20
- Parent:
- 4:f74c981d9bc0
- Child:
- 7:1bffab95fc5f
File content as of revision 5:d396168a1b20:
#include "mbed.h" #include "MODSERIAL.h" DigitalOut ledG(LED_GREEN); DigitalOut ledR(LED_RED); DigitalOut ledB(LED_BLUE); MODSERIAL pc(USBTX, USBRX); int main() { //int i = 0; pc.baud(115200); pc.printf("Hello World!\r\n"); pc.printf("They're just using coconuts!"); ledR = true; ledB = true; ledG = true; while (true) { int keyPress = pc.getc(); pc.putc(keyPress); 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; } } }