With added boundaries, without errors, not yet tested

Dependencies:   HIDScope MODSERIAL QEI biquadFilter mbed

Fork of prog_forwardkin_feedback_copy by Gerhard Berman

Revision:
11:773b3532d50f
Parent:
10:45473f650198
Child:
12:05e5964b69a4
--- a/main.cpp	Wed Oct 19 16:14:25 2016 +0000
+++ b/main.cpp	Wed Oct 19 16:28:11 2016 +0000
@@ -24,7 +24,7 @@
 //library settings
 Serial pc(USBTX,USBRX);
 Ticker MeasureTicker, BiQuadTicker; //, TimeTracker; // sampleT;
-HIDScope    scope(3);
+HIDScope    scope(4);
 
 //set initial conditions
 float error1_prev = 0;
@@ -90,8 +90,8 @@
     float q2 = Encoder2Position*inverse_gear_ratio;
       
     //get velocity vector v = (Pe*- Pe) = [0; dx; dy] from EMG  
-    float biceps1 = button1.read();
-    float biceps2 = button2.read();
+    float biceps1 = !button1.read();
+    float biceps2 = !button2.read();
     if (biceps1 > 0 && biceps2 > 0){
         //both arms activated: stamp moves down
         led1 = 1;
@@ -165,6 +165,14 @@
     
     error1_prev = error1;
     error2_prev = error1;
+    float biceps1 = !button1.read();
+    float biceps2 = !button2.read();
+       
+    scope.set(0,q1_dot);
+    scope.set(1,q2_dot);
+    scope.set(2,biceps1);
+    scope.set(3,biceps2);
+    scope.send();
 }
 
 void SetMotor1(float motorValue1, float motorValue2)