![](/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
main.cpp@3:99a568200720, 2017-09-12 (annotated)
- Committer:
- tvlogman
- Date:
- Tue Sep 12 15:07:38 2017 +0000
- Revision:
- 3:99a568200720
- Parent:
- 2:002f6b69ebaf
- Child:
- 4:f74c981d9bc0
- Child:
- 6:5f433011819f
Added variable keyPress which stores the character key pressed;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vsluiter | 0:c8f15874531b | 1 | #include "mbed.h" |
vsluiter | 0:c8f15874531b | 2 | #include "MODSERIAL.h" |
vsluiter | 0:c8f15874531b | 3 | |
tvlogman | 3:99a568200720 | 4 | DigitalOut ledG(LED_GREEN); |
tvlogman | 3:99a568200720 | 5 | DigitalOut ledR(LED_RED); |
tvlogman | 3:99a568200720 | 6 | DigitalOut ledB(LED_BLUE); |
vsluiter | 0:c8f15874531b | 7 | MODSERIAL pc(USBTX, USBRX); |
vsluiter | 0:c8f15874531b | 8 | |
vsluiter | 0:c8f15874531b | 9 | int main() |
vsluiter | 0:c8f15874531b | 10 | { |
tvlogman | 2:002f6b69ebaf | 11 | //int i = 0; |
vsluiter | 0:c8f15874531b | 12 | pc.baud(115200); |
Gijsvanoort | 1:40470bc517f1 | 13 | pc.printf("Hello World!\r\n"); |
vsluiter | 0:c8f15874531b | 14 | |
tvlogman | 3:99a568200720 | 15 | ledR = true; |
tvlogman | 3:99a568200720 | 16 | ledB = true; |
tvlogman | 3:99a568200720 | 17 | |
vsluiter | 0:c8f15874531b | 18 | while (true) { |
tvlogman | 3:99a568200720 | 19 | int keyPress = pc.getc(); |
tvlogman | 3:99a568200720 | 20 | pc.putc(keyPress); |
tvlogman | 3:99a568200720 | 21 | ledG = !ledG; // toggle a led |
tvlogman | 2:002f6b69ebaf | 22 | |
vsluiter | 0:c8f15874531b | 23 | } |
vsluiter | 0:c8f15874531b | 24 | } |