script zover

Dependencies:   HIDScope MODSERIAL mbed

Revision:
9:cc60d28643cb
Parent:
8:37563d2ec529
Child:
10:c7140e085ff3
Child:
11:91d827c62a50
--- a/main.cpp	Mon Oct 20 10:12:00 2014 +0000
+++ b/main.cpp	Mon Oct 20 10:58:07 2014 +0000
@@ -78,9 +78,9 @@
 void viewer()
 {
     scope.set(0,emg_value);
-    scope.set(1,yhp1);
-    scope.set(2,ylp1);
-    scope.set(3,yn);
+    scope.set(1,yn);
+    scope.set(2,yhp1);
+    scope.set(3,ylp1);
     scope.set(4,yave);
     
     scope.send();
@@ -105,11 +105,11 @@
         yhp1 = hpfilter1(yn);  //function hpfilter
         ylp1 = lpfilter1(yhp1);       //function filter
        
-        ysum = ysum+yn;
+        ysum = ysum+sqrt(ylp1*ylp1);
         n++;
        
         if(n==100) {
-            yave = ysum/100;
+            yave = abs(ysum/100);
             ysum = 0;
             n = 0;
             }