Robot
Dependencies: HIDScope MODSERIAL Motordriver QEI Servo mbed
Fork of The_Claw_with_EMG_Control_PID by
Diff: main.cpp
- Revision:
- 14:65780d480874
- Parent:
- 13:dd7b41766f5f
- Child:
- 15:caf29b6f5261
diff -r dd7b41766f5f -r 65780d480874 main.cpp --- 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{