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@6:5f433011819f, 2017-09-13 (annotated)
- Committer:
- tvlogman
- Date:
- Wed Sep 13 12:06:37 2017 +0000
- Revision:
- 6:5f433011819f
- Parent:
- 3:99a568200720
- Child:
- 7:1bffab95fc5f
Added message "bananas"
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"); |
tvlogman | 6:5f433011819f | 14 | pc.printf("Bananas"); |
vsluiter | 0:c8f15874531b | 15 | |
tvlogman | 3:99a568200720 | 16 | ledR = true; |
tvlogman | 3:99a568200720 | 17 | ledB = true; |
tvlogman | 3:99a568200720 | 18 | |
vsluiter | 0:c8f15874531b | 19 | while (true) { |
tvlogman | 3:99a568200720 | 20 | int keyPress = pc.getc(); |
tvlogman | 3:99a568200720 | 21 | pc.putc(keyPress); |
tvlogman | 3:99a568200720 | 22 | ledG = !ledG; // toggle a led |
tvlogman | 2:002f6b69ebaf | 23 | |
vsluiter | 0:c8f15874531b | 24 | } |
vsluiter | 0:c8f15874531b | 25 | } |