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 biquadFilter mbed
Fork of EMGvoorjan by
Diff: main.cpp
- Revision:
- 23:b5a09f96c2d7
- Parent:
- 21:77998ce2c0dd
- Child:
- 24:fe3825337233
diff -r 77998ce2c0dd -r b5a09f96c2d7 main.cpp
--- a/main.cpp Fri Oct 20 11:22:11 2017 +0000
+++ b/main.cpp Tue Oct 24 08:55:02 2017 +0000
@@ -1,6 +1,7 @@
#include "mbed.h"
#include "HIDScope.h"
#include "BiQuad.h"
+#include "math.h"
//Define objects
AnalogIn emg0( A0 );
@@ -37,7 +38,9 @@
void emgSample() {
double emgFiltered = bqc.step( emg.read() );
+double emgabs = abs(emgFiltered);
scope.set(0, emgFiltered );
+scope.set(1, emgabs );
scope.send();
}
