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:
- 17:616ce7bc1f96
- Parent:
- 16:27430afe663e
- Child:
- 18:65e24db15c69
- Child:
- 19:f08b5cd2b7ce
diff -r 27430afe663e -r 616ce7bc1f96 main.cpp --- a/main.cpp Thu Sep 21 11:20:03 2017 +0000 +++ b/main.cpp Thu Sep 21 11:53:09 2017 +0000 @@ -28,18 +28,16 @@ volatile float x; volatile float x_prev =0; volatile float y; // filtered 'output' of ReadAnalogInAndFilter -volatile float ledBrightness = 0.00; - +// Initializing encoder Ticker encoderTicker; volatile int counts = 0; volatile float revs = 0.00; - - void readEncoder(){ counts = Encoder.getPulses(); - revs = counts/64.0f; + revs = counts/(131*64.0f); + pc.printf("%0.2f revolutions \r\n", revs); // Displaying revs in HIDscope x = revs; // Capture data