Hello,
I am teaching a middle school robotics class using VEX IQ. I am trying to have a classroom competition where the students program an autonomous and then follow with a driver control period. I am trying to make this as simple as possible using VEXcode blocks and use 2 motor drivetrain. What we are doing currently is creating 2 seperate programs, and autonomous and a driver control but I would like to create 1 program similar to the competition template for V5 but there are no blocks for When Autonomous and When Driver Control.
How do I have program a driver control period using the code I have in the picture?
OK I can’t do blocks at the moment, but you would want to say
LeftMotor.setVelocity((Controller1. AxisA, position)+(Controller1. AxisB, position));
RighttMotor.setVelocity((Controller1. AxisA, position)-(Controller1. AxisB, position));
Drivetrain.drive(forward);
I think that is right, but if the turning is backwards just chage the + or - sign.
I appreciate the quick replies but I am trying to use the drivetrain device setup to keep their auton simple. There seems to be no way to isolate the drivetrain motors to program them individually. If they setup as standard motors they will have to create their own blocks to drive forward for a distance in inches and to turn to an exact degrees during an autonomous period.
Here’s something that might work. It’s EXP code but I assume the same thing should work in IQ:
Student autonomous code would go under “define Autonomous.” I don’t see a way to limit the time for autonomous mode, but it looks like you weren’t trying to do that anyway.
(Edited): Controller is enabled after A button is pressed. (I originally posted a more complicated and less effective version, not realizing that “Controller Disable” only disables the menu-configured controller behavior, and doesn’t stop you from waiting for a button press.)