Het complete motorscript met alle gewenste functies

Dependencies:   HIDScope MODSERIAL QEI biquadFilter mbed

Fork of Motor_EMG_Definitief by Margreeth de Breij

Revision:
9:350a82a7745a
Parent:
8:86a13efe98c8
Child:
10:5c5f2ea11045
--- a/main.cpp	Thu Oct 29 12:12:28 2015 +0000
+++ b/main.cpp	Thu Oct 29 15:21:45 2015 +0000
@@ -48,7 +48,7 @@
     double position2 = 0, position1 = 0;
     double m2_ref = 0, m1_ref = 0;
     int count = 0;
-    double Grens2 = 70, Grens1 = 70;
+    double Grens2 = 60, Grens1 = 60;
     double Stapgrootte = 1;
    
 // Declaring variables
@@ -354,9 +354,9 @@
                 {
                     m1_ref = m1_ref + Stapgrootte;
                     
-                    if (m1_ref < -1*m2_ref + 80 )
+                    if (m1_ref > m2_ref + 35 )
                     {
-                        m1_ref = -1*m2_ref + 80 ;
+                        m1_ref = m2_ref + 35 ;
                     }
                     wait(0.05);
                 }
@@ -364,9 +364,9 @@
                 {
                     m1_ref = m1_ref - Stapgrootte;
                   
-                    if (m1_ref > Grens1 )
+                    if (m1_ref < -1*Grens1 )
                     {
-                        m1_ref = Grens1;
+                        m1_ref = -1*Grens1;
                     }
                     wait(0.05);
                 }
@@ -385,9 +385,9 @@
                 {   
                     m1_ref = m1_ref - Stapgrootte;
                   
-                    if (m1_ref < -1*m2_ref + 80 )
+                    if (m1_ref < m2_ref - 35 )
                     {
-                        m1_ref = -1*m2_ref + 80 ;
+                        m1_ref = m2_ref - 35 ;
                     }
                     wait(0.05);
                 }