We are using VEXcode V5 Text software , VEXnet Competition Switch and are having a problem getting our pre_auton function to run. The autonomous and the usercontrol functions seems to work well with the switch. Is there something we are missing about the competition switch? Or, an issue with the code? Or, should we develop a second program and store it in slot #2 and run it to remove the tower motors’ backlash . I have included the code for pre_auton() and int main().
Thanks in advance,
David
void pre_auton(void) {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions,
// Remove backlash from tower motors by rotating downward for 4 seconds
// Then reset the degrees on the Claw and Tower motors
RightTower.spinFor(-300,degrees,25,velocityUnits::pct, false);
LeftTower.spinFor(-300,degrees,25,velocityUnits::pct, false);
wait(4000, msec);
LeftTower.resetRotation();
RightTower.resetRotation();
Claw.resetRotation();
}
int main() {
// Set up callbacks for autonomous and driver control periods.
Competition.autonomous(autonomous);
Competition.drivercontrol(usercontrol);
// Run the pre-autonomous function.
pre_auton();
// Prevent main from exiting with an infinite loop.
while (true) {
wait(100, msec);
}
}