EMG input library biorobortics 31-10-2016

Dependencies:   HIDScope mbed

Fork of EMG by Tom Tom

Revision:
28:ceed9f02b815
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EMG_input.h	Fri Oct 28 09:44:54 2016 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "BiQuad.h"
+#include "math.h"
+#define EMG_DEBUG
+#ifndef M_PI
+#define M_PI    3.14159265358979323846
+#endif
+
+#define EMG_THRESHOLD   0.2
+
+class EMG_input {
+    private:
+        AnalogIn emg0;     // Declare port
+        BiQuad bq1, bq2, bq3, bq4, bq5, bq6, bq7, bq8;  // Declare biquads
+        BiQuadChain bqc1, bqc2;  // Declare biquad chains
+        double maxsig;  // Maximum signal value, used for calibrating output between 0 and 1.
+          
+    public:
+        double e0, e0f, e0flow, discrete;
+        EMG_input(PinName pin);
+        void tick(void);
+        bool read(void);
+        ~EMG_input();
+        
+};
\ No newline at end of file