i dont know what language your using, but in java it would look something like this
Code:
if(!limitSwitch.get()){
motor.set(1.0);
}else if(limitSwitch.get()){
motor.set(0.0);
}
in englsih all this is doing is saing, if the limit switch if false (not pressed) spin the motor, then in the else if statement, it checks if the limit switch is true (pressed) and if it is, it will stop the motor, if you want it so once its in this state, you press a button to shoot, the code would be this;
Code:
if(!limitSwitch.get()){
motor.set(1.0);
}else if(limitSwitch.get()){
motor.set(0.0);
}else if(controller.getRawButton(1)){
motor.set(1.0);
}