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:
- 15:c1a8f28d6583
- Parent:
- 14:371e0d505971
- Child:
- 16:8f175d2a472f
--- a/main.cpp Thu Oct 08 15:31:50 2015 +0000
+++ b/main.cpp Fri Oct 09 09:00:16 2015 +0000
@@ -1,15 +1,15 @@
#include "mbed.h"
#include "HIDScope.h"
#include "Filterdesigns.h"
-#include "MODSERIAL.h"
+//#include "MODSERIAL.h" //bugfix
AnalogIn emg(A0); //Analog input van emg kabels
-HIDScope scope(2); //3 scopes
+HIDScope scope(3); //3 scopes
Ticker EMGticker;
-MODSERIAL pc(USBTX, USBRX);
+//MODSERIAL pc(USBTX, USBRX); //bugfix
//Sample frequentie
-double Fs = 5; //Hz
+double Fs = 500; //Hz
double t = 1/ Fs; // voor EMGticker
double y = 0;
@@ -19,11 +19,11 @@
//uitlezen emg signaal
double u = emg.read();
Filterdesigns(u,y, ymean);
- pc.printf("%f \n",y);
+// pc.printf("%f \n",u); //bugfix
// Plotten in HIDscope
- //scope.set(0,u); //ongefilterde waarde naar scope 1
- //scope.set(1,y); //gefilterde waarde naar scope 2
- //scope.set(0,ymean); // gefilterde en gemiddelde waarde naar scope 3
+ 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
}