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 mbed MODSERIAL
Diff: main.cpp
- Revision:
- 9:1655d67d8a53
- Parent:
- 8:a8c66bd140f8
- Child:
- 10:897db0bdb2fe
--- a/main.cpp Wed Oct 07 12:47:22 2015 +0000
+++ b/main.cpp Wed Oct 07 13:48:19 2015 +0000
@@ -1,6 +1,7 @@
#include "mbed.h"
#include "HIDScope.h"
#include "Filterdesigns.h"
+#include "Meanvalue.h"
AnalogIn emg(A0); //Analog input van emg kabels
HIDScope scope(3); //2 scopes
@@ -10,13 +11,20 @@
double Fs = 500; //Hz
double t = 1/ Fs; // voor EMGticker
-double y = 0;
+// gemidelde waarde
+double sum = 0;
double ymean = 0;
+int a = 0;
+int delay = 40;
+
+double y=0;
+
void EMGfilter(){
//uitlezen emg signaal
double u = emg.read();
- Filterdesign1(u,y, ymean);
+ Filterdesign1(u, y);
+ double ymean = Meanvalue(y, sum, ymean, a, delay);
// Plotten in HIDscope
scope.set(0,u); //ongefilterde waarde naar scope 1