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-19
- Revision:
- 7:1bffab95fc5f
- Parent:
- 6:5f433011819f
- Parent:
- 5:d396168a1b20
- Child:
- 8:0067469c3389
File content as of revision 7:1bffab95fc5f:
#include "mbed.h" #include "MODSERIAL.h" PwmOut ledPwm(D5); float pwmPeriod = 1.0/5000.0; AnalogIn pot(A5); DigitalIn button(D3); MODSERIAL pc(USBTX, USBRX); int main() { pc.baud(115200); pc.printf("Hello World!\r\n"); ledPwm.period(pwmPeriod); while (true) { float potMeterValue = pot.read(); ledPwm = potMeterValue; wait(0.1f); } }