Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:7b9a7d869ac5, committed 2015-09-21
- Comitter:
- hjlschneider
- Date:
- Mon Sep 21 13:41:49 2015 +0000
- Parent:
- 0:e63c5451c573
- Commit message:
- Het deel met emg.read() werkt waarschijnlijk niet. Als er rare dingen gebeuren moet dat weggehaald worden
Changed in this revision
HIDScope.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e63c5451c573 -r 7b9a7d869ac5 HIDScope.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HIDScope.lib Mon Sep 21 13:41:49 2015 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/tomlankhorst/code/HIDScope/#5020a2c0934b
diff -r e63c5451c573 -r 7b9a7d869ac5 main.cpp --- a/main.cpp Mon Sep 21 12:58:23 2015 +0000 +++ b/main.cpp Mon Sep 21 13:41:49 2015 +0000 @@ -1,6 +1,8 @@ #include "mbed.h" +#include "HIDScope.h" // Define the storage variables and filter coefficients for two filters +AnalogIn emg(A0); //Analog input EMG Ticker biquadTicker; double f1_v1=0, f1_v2=0, f2_v1=0, f2_v2=0, f3_v1=0, f3_v2=0; //v staat uitgelegd in de slides van DRS const double f1_a1=-1.05803167147, f1_a2=0.30140492806, f1_b0=1.00000000000, f1_b1=1.72709218153, f1_b2=1.00000000000; //f1 = filter 1, f2 = filter 2, etc @@ -17,8 +19,8 @@ //This is your controller, call it using a Ticker void myController(){ - double u1 = 0.118800, u2 = 0.139873, u3 = 0.149838; //Dit zijn de gains uit ASN filter - double y1 = biquad(u1, f1_v1, f1_v2, f1_a1, f1_a2, f1_b0, f1_b1, f1_b2); //Vul hier de u, v1, v2, a1, a2, b0, b1 en b2 van de juist filter in + double u1 = 0.118800*emg.read(), u2 = 0.139873*emg.read(), u3 = 0.149838*emg.read(); //Dit zijn de gains uit ASN filter + double y1 = biquad(u1, f1_v1, f1_v2, f1_a1, f1_a2, f1_b0, f1_b1, f1_b2); //Vul hier de u, v1, v2, a1, a2, b0, b1 en b2 van de juist filter in double y2 = biquad(u2, f2_v1, f2_v2, f2_a1, f2_a2, f2_b0, f2_b1, f2_b2); double y3 = biquad(u3, f3_v1, f3_v2, f3_a1, f3_a2, f3_b0, f3_b1, f3_b2); }