I am trying to code my robot arm to move down if it goes too high but the code is not working. it never goes back down if it goes too high. This is the code that I have right now.
int main() {
while (1) {
TurretMotor1.setVelocity(Controller1.Axis4.position(), percent);
armMotor2.setVelocity(Controller1.Axis3.position(), percent);
TurretMotor1.spin(forward);
armMotor2.spin(forward);
/*
Controller1.Screen.print(PotentiometerA.angle(percent));
//Controller1.Screen.print();
wait(0.1, seconds);
Controller1.Screen.clearLine(1);
*/
Controller1.Screen.print(PotentiometerA.angle(percent));
wait(.1, seconds);
Controller1.Screen.clearScreen();
Controller1.Screen.setCursor(1, 1);
if (PotentiometerA.angle(percent)>95) {
armMotor2.stop();
armMotor2.setVelocity(50, percent);
armMotor2.spin(forward);
}
}
}