This is my first year back in V5. I saw that vexcode text was unsupported so I figured I need to use the visual studio extension. When I was experimenting I ran into two issues. First in an attempt to have a bot go forward, turn, and go forward again in autonomous only the first line of my code will run. I have messed with the optional paramater at the end to see if that helps, but no. Drivetrain.driveFor(5310, mm);
Drivetrain.turnFor(100, degrees);
Drivetrain.driveFor(5000,mm);
The second issue is my attempt to use the drivetrain and control it with the joysticks. Here is the code I attempted:
int main() {
// Create Controller callback events - 15 msec delay to ensure events get registered
Controller1.ButtonL1.pressed(controller_L1_Pressed);
Controller1.ButtonL2.pressed(controller_L2_Pressed);
Controller1.ButtonR1.pressed(controller_R1_Pressed);
Controller1.ButtonR2.pressed(controller_R2_Pressed);
wait(15,msec);
// Configure Arm and Claw motor hold settings and velocity
ArmMotor.setStopping(hold);
ClawMotor.setStopping(hold);
ArmMotor.setVelocity(60, percent);
ClawMotor.setVelocity(30, percent);
// Main Controller loop to set motors to controller axis postiions
while(true){
LeftMotor.setVelocity(Controller1.Axis3.position(), percent);
RightMotor.setVelocity(Controller1.Axis2.position(), percent);
LeftMotor.spin(forward);
RightMotor.spin(forward);
wait(5, msec);
}
}
Any help to understand what I am doing wrong would be greatly appreciated.