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.
Dependencies: HIDScope MODSERIAL QEI TextLCD mbed
Fork of TotalControlEmg2 by
Diff: main.cpp
- Revision:
- 5:b400209df739
- Parent:
- 4:3b9e2d49d5fb
- Child:
- 6:8197f9446daf
diff -r 3b9e2d49d5fb -r b400209df739 main.cpp --- a/main.cpp Tue Oct 06 14:25:53 2015 +0000 +++ b/main.cpp Wed Oct 07 11:10:36 2015 +0000 @@ -2,6 +2,8 @@ #include "HIDScope.h" #include "encoder.h" #include "Filter.h" +#include "Meanvalue.h" +#include "Filterdesigns.h" AnalogIn emg(A0); //Analog input van emg kabels Ticker EMGticker; @@ -12,8 +14,16 @@ //Sample frequentie double Fs = 500; //Hz double t = 1/ Fs; // voor EMGticker + double gem = 0.4557; // gemiddelde waarde emgsignaal +//gemiddelde bepalen +double sum = 0; +double ymean = 0; +int a = 0; +int delay = 40; + + // Filter1a: 50Hz Notch double v1_50a = 0, v2_50a = 0; const double a1_50a = -1.56858163817, a2_50a = 0.96424138921; @@ -64,7 +74,7 @@ double y = 10 * yLP; - double ymean = Meanvalue(y); + double ymean = Meanvalue(y, sum, a, ymean, delay); // Plotten in HIDscope scope.set(0,u); //ongefilterde waarde naar scope 1