backup

Dependencies:   MODSERIAL Motordriver QEI Servo mbed HIDScope

Fork of The_Claw_Back-up_Buttons by Meike Froklage

Revision:
14:65780d480874
Parent:
13:dd7b41766f5f
--- a/main.cpp	Wed Nov 02 18:46:03 2016 +0000
+++ b/main.cpp	Wed Nov 02 18:56:54 2016 +0000
@@ -398,14 +398,14 @@
                 Arm.stop(1)==1;
 
             
-                if (rlf_y > threshold_value) {
+                if (btn&&!btn2) {
                     if(position_cart > -105 && position_arm >= 95){             //If the cart is not at the end, the arm can't move any further than 45 degrees
                     Arm.stop(1)==1;
                     
                     }else if(position_cart > -105 && position_arm >= 25 && position_claw == 27){
                     Arm.stop(1)==1;
                         
-                    }else if(position_cart<= -105 && position_arm>=80){         //If the cart is at the right end, the arm can't move any further than 70 degrees
+                    }else if(position_cart<= -105 && position_arm>=160){         //If the cart is at the right end, the arm can't move any further than 70 degrees
                     Arm.stop(1)==1;
     
                     }else{
@@ -416,14 +416,14 @@
                             Cart.stop(1)==1;
                         }
          
-                }else if (llf_y > threshold_value) {
+                }else if (!btn&&btn2) {
                     if(position_cart < 105 && position_arm <= -95){             //If the cart is not at the end, the arm can't move any further than 45 degrees 
                     Arm.stop(1)==1;
                     
                     }else if(position_cart < 105 && position_arm <= -25 && position_claw == -18){
                     Arm.stop(1)==1;
                     
-                    }else if(position_cart>=105 && position_arm<=-80){          //If the cart is at the left end, the arm can't move any further than 70 degrees
+                    }else if(position_cart>=105 && position_arm<=-160){          //If the cart is at the left end, the arm can't move any further than 70 degrees
                     Arm.stop(1)==1;
     
                     }else{