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:
- 7:040591b3f019
- Parent:
- 6:8197f9446daf
- Child:
- 8:a8c66bd140f8
--- a/main.cpp Wed Oct 07 11:46:29 2015 +0000
+++ b/main.cpp Wed Oct 07 12:42:19 2015 +0000
@@ -1,15 +1,29 @@
#include "mbed.h"
#include "encoder.h"
+#include "HIDScope.h"
#include "Filterdesigns.h"
+AnalogIn emg(A0); //Analog input van emg kabels
+HIDScope scope(3); //2 scopes
Ticker EMGticker;
//Sample frequentie
double Fs = 500; //Hz
double t = 1/ Fs; // voor EMGticker
+double y = 0;
+double ymean = 0;
+
void EMGfilter(){
- Filterdesign1();
+ //uitlezen emg signaal
+ double u = emg.read();
+ Filterdesign1(u,y, ymean);
+
+ // Plotten in HIDscope
+ scope.set(0,u); //ongefilterde waarde naar scope 1
+ scope.set(1,y); //gefilterde waarde naar scope 2
+ scope.set(2,ymean); // gefilterde en gemiddelde waarde naar scope 3
+ scope.send(); //stuur de waardes naar HIDscope
}