f

Dependencies:   HIDScope biquadFilter mbed

Files at this revision

API Documentation at this revision

Comitter:
JurrienBos
Date:
Mon Oct 29 15:06:12 2018 +0000
Commit message:
hh

Changed in this revision

HIDScope.lib Show annotated file Show diff for this revision Revisions of this file
biquadFilter.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 6c6907217e7a HIDScope.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HIDScope.lib	Mon Oct 29 15:06:12 2018 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/tomlankhorst/code/HIDScope/#d23c6edecc49
diff -r 000000000000 -r 6c6907217e7a biquadFilter.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/biquadFilter.lib	Mon Oct 29 15:06:12 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/tomlankhorst/code/biquadFilter/#26861979d305
diff -r 000000000000 -r 6c6907217e7a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 29 15:06:12 2018 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "BiQuad.h"
+#include "HIDScope.h"
+
+Ticker      sample_timer;
+HIDScope    scope(2);
+
+BiQuadChain bqc;
+BiQuad BqNotch1( 9.98224e-01, -1.61516e+00, 9.98224e-01, -1.61555e+00, 9.98222e-01 );
+BiQuad BqNotch2( 1.00000e+00, -1.61804e+00, 1.00000e+00, -1.61764e+00, 9.98227e-01 );
+
+BiQuad BqHP( 9.86760e-01, -1.97352e+00, 9.86760e-01, -1.97334e+00, 9.73695e-01 );
+//BiQuad BqLP( 3.46041e-04, 6.92083e-04, 3.46041e-04, -1.94670e+00, 9.48082e-01 );
+
+Ticker emgSampleTicker;
+AnalogIn emg0( A0 );
+AnalogIn emg1 (A1) ;
+//volatile double emgFiltered;
+//volatile double emgSampleabs;
+
+void emgSample() 
+{
+double emgFiltered = bqc.step( emg0.read() );
+bqc.add( &BqNotch1 ).add( &BqNotch2 ).add( &BqHP );
+//emgSampleabs = fabs(emgFiltered); 
+}
+
+void sample()
+{
+    scope.set(0, emg0.read() );
+    scope.set(1, emg1.read() );
+    scope.send();
+}
+
+int main() 
+{
+emgSampleTicker.attach( &emgSample, 0.01 );
+sample_timer.attach(&sample, 0.002);
+while( true ){}
+}
\ No newline at end of file
diff -r 000000000000 -r 6c6907217e7a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 29 15:06:12 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/675da3299148
\ No newline at end of file