My motor will not stop unless I press Y, I added Y because the motor will not stop. Can anyone help me figure out why? My function for the motor is below.
void LiftMotor() {
if (Controller1.ButtonX.pressing()) {
liftpos = 50;
liftspeed = liftpos * liftexcel;
liftMotor.spin(forward, liftspeed, percent);
liftMotor.setStopping(vex::brakeType::hold);
}
else if (Controller1.ButtonB.pressing()) {
liftpos = -50;
liftspeed = liftpos * liftexcel;
liftMotor.spin(forward, liftspeed, percent);
liftMotor.setStopping(vex::brakeType::hold);
}
if (Controller1.ButtonY.pressing()) {
liftpos = 0;
liftspeed = liftpos * liftexcel;
liftMotor.spin(forward, liftspeed, percent);
}
if (Controller1.ButtonX.pressing()){
Brain.Screen.print("True");
}
}