emg

Dependencies:   HIDScope MODSERIAL mbed-dsp mbed TouchButton

Fork of test by BMT M9 Groep01

Files at this revision

API Documentation at this revision

Comitter:
Tanja2211
Date:
Mon Oct 27 12:45:32 2014 +0000
Parent:
27:9adedca4644e
Child:
29:52a0d241e1b0
Commit message:
motor 2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Oct 27 12:28:10 2014 +0000
+++ b/main.cpp	Mon Oct 27 12:45:32 2014 +0000
@@ -67,7 +67,7 @@
     filtered_emgT = fabs(filtered_emgT);
 
     //Triceps moving average
-    T0=filtered_emgT;
+    T0=filtered_emgT*100;
     MOVAVG_T=T0*0.03333+T1*0.03333+T2*0.03333+T3*0.03333+T4*0.03333+T5*0.03333+T6*0.03333+T7*0.03333+T8*0.03333+T9*0.03333+T10*0.03333+T11*0.03333+T12*0.03333+T13*0.03333+T14*0.03333+T15*0.03333+T16*0.03333+T17*0.03333+T18*0.03333+T19*0.03333+T20*0.03333+T21*0.03333+T22*0.03333+T23*0.03333+T24*0.03333+T25*0.03333+T26*0.03333+T27*0.03333+T28*0.03333+T29*0.03333;
     T29=T28;
     T28=T27;
@@ -207,13 +207,13 @@
     arm_biquad_cascade_df1_init_f32(&highpassT,1,highpass_const,highpass_states);
 
     log_timerT1.attach(Triceps, 0.005);
-    wait(5);
+    wait(30);
     log_timerT1.detach();
 
     MOVAVG_T=MOVAVG_Positie1;
 
     // positie van batje met behulp van Triceps
-    drempelwaardeT=0.001;
+    drempelwaardeT=0.1;
 
     if (MOVAVG_Positie1>= drempelwaardeT) {
         yT1=1;
@@ -240,6 +240,7 @@
     } else {
         yT2=0;
     }
+    pc.printf("Triceps tweede meting is klaar.\n");
 
     //*** INPUT MOTOR 2 ***
     positie=yT1+yT2;
@@ -247,14 +248,13 @@
     //controle positie op scherm
     if (positie==0) {
         pc.printf("Motor 2 gaat naar stand 0\n");
-    } else {
-        if (positie==1) {
-            pc.printf("Motor 2 gaat naar stand 1\n");
-        } else {
-            if (positie==2) {
-                pc.printf("Motor 1 beweegt met snelheid 2\n");
-            }
-        }
+    }
+    if (positie==1) {
+        pc.printf("Motor 2 gaat naar stand 1\n");
+    }
+    if (positie==2) {
+        pc.printf("Motor 2 beweegt met snelheid 2\n");
+
     }
 
     wait(5);
@@ -269,7 +269,7 @@
     wait(5);//log_timerB wordt 2000 keer uitgevoerd
     log_timerB.detach();
 
-    //bepaling van snelheidsstand met biceps
+//bepaling van snelheidsstand met biceps
 
     drempelwaardeB1=2;
     drempelwaardeB2=5;
@@ -291,10 +291,10 @@
         yB1=0;
     }
 
-    //*** INPUT MOTOR 1 ***
+//*** INPUT MOTOR 1 ***
     snelheidsstand=yB1+yB2+yB3;
 
-    //controle snelheidsstand op scherm
+//controle snelheidsstand op scherm
     if (snelheidsstand==0) {
         pc.printf("Motor 1 beweegt niet\n");
     } else {