Help with claw code

I know that i have asked a similar question before, but this one is slightly different. So right now we have a cap flipper that activates with the two back controller buttons, R1 and L1.(BTW V5, VCS; C++) After we press either of the two back buttons, the motor continues to spin, so we have to press “A” to stop the motor from burning out. I wanted to know if there is a way to make my code from the claw motor to continue to spin into the claw motor spinning only 180 degrees, or stops when the button is released.(Preferably the former one) Any help would be appreciated :slight_smile:

The following is my claw code which includes R1 L1 and the A button:

 
    if(Controller1.ButtonR1.pressing()){
    MotoryClawie.spin(vex::directionType::fwd);
    }
    if(Controller1.ButtonL1.pressing()){
    MotoryClawie.spin(vex::directionType::rev);
    }
    if(Controller1.ButtonA.pressing()){
    MotoryClawie.stop();
    }

You could change the if pressing A into an else statement. If you want it to stop when you let go.
if you want it to turn for 180 degrees use the start rotate for command.

so would i just get rid of the Press A all together?

yes
Api refrence for start rotate for:

would this work

if(Controller1.ButtonR1.pressing()){
    MotoryClawie.spin(vex::directionType::fwd);
    }
    if(Controller1.ButtonL1.pressing()){
    MotoryClawie.spin(vex::directionType::rev);
    }
    else{
    MotoryClawie.stop();
    }

sorry for all the q’s

That would work if you want it to stop when you let go.

ok thx :slight_smile:

@7517j
The else isn’t a function so it wouldn’t need those parenthesis
edit: nevermind you fixed it.