Werkt

Dependencies:   Encoder HIDScope MODSERIAL QEI mbed

Fork of Inverse_kinematics_PIDController by Casper Kroon

Revision:
15:6f5b97d006c2
Parent:
14:a98bc99ea004
--- a/main.cpp	Thu Nov 01 15:51:40 2018 +0000
+++ b/main.cpp	Fri Nov 02 09:38:18 2018 +0000
@@ -104,7 +104,7 @@
         //correction on x- axis
         old_x_correction = x_correction;
         x_correction = old_x_correction + (length * cos(old_motor1_angle / C1)- length * cos(motor1_angle/ C1)); // old x + correction
-        motor2_angle = ( x_position + x_correction - (length * cos(motor1_angle /C1 ))) / C2;
+        //motor2_angle = ( x_position + x_correction - (length * cos(motor1_angle /C1 ))) / C2;
         
     }
     
@@ -138,7 +138,7 @@
         else if (x_position < 0.0f){
             x_position = 0.0f;
         }
-        motor2_angle =( x_position + x_correction - (length * cos( motor1_angle / C1 ))) /C2 ; // sawtooth-gear motor angle in rad
+        //motor2_angle =( x_position + x_correction - (length * cos( motor1_angle / C1 ))) /C2 ; // sawtooth-gear motor angle in rad
         
         //reset the boolean, for demo purposes
         emg2Bool = false; 
@@ -223,10 +223,10 @@
 
 void tickermain() {
     if(!buttonleft){
-        emg0Bool = true;
+        motor2_angle = 4.0f;
     }
     else if(!buttonright) {
-        emg2Bool = true;
+        motor2_angle = 2.0f;
     }
     xDirection(); //call the function to move in the y direction
     yDirection(); //call the function to move in the x direction