Made a ouple of adjustments, still nothing. I have Psudocoded the part of my code that holds my lift when I’mnot moving the joystick. Wrote print codes at the ends of each result and nothing displays. Tunning out of ideas. Any help would be great!
void height_up(void) {
i++;
if (i >= 0 && i < 4) {
if (i == 0) {
RLift.rotateTo(double(-129), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(88), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "Ground Level/n");
} else if (i == 1) {
RLift.rotateTo(double(-859), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(787), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "LOW TOWER/n");
} else if (i == 2) {
RLift.rotateTo(double(-859), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(787), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "MID TOWER/n");
} else {
RLift.rotateTo(double(-1420), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(1370), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "TALL TOWER/n");
}
}
else {
i--;
}
}
void height_down(void) {
i--;
if (i >= 0 && i < 4) {
if (i == 0) {
RLift.rotateTo(double(-129), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(88), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "Ground Level/n");
} else if (i == 1) {
RLift.rotateTo(double(-859), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(787), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "LOW TOWER/n");
} else if (i == 2) {
RLift.rotateTo(double(-859), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(787), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "MID TOWER/n");
} else {
RLift.rotateTo(double(-1420), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
LLift.rotateTo(double(1370), vex::rotationUnits::deg, double(75),
vex::velocityUnits::pct);
Lift.stop(vex::brakeType::hold);
LLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
RLift.spin(vex::directionType::fwd, (Controller1.Axis2.value()),
vex::velocityUnits::pct);
Brain.Screen.printAt(1, 20, "TALL TOWER/n");
}
}
else {
i++;
}
}
Controller1.ButtonUp.pressed(height_up);
Controller1.ButtonDown.pressed(height_down);
Thank you