Drivetrain code help in Vexcode Text

Hi, I am using the “drivetrain” to code my arcade control drivetrain but don’t know how to get the motor values for each of the left and right motors. It is a 2 wheel drive. Usually, when I don’t use the “drivetrain”, I would use this.
LeftMotor.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct),velocityUnits::pct); RightMotor.spin(directionType::fwd,Controller1.Axis2.position(percentUnits::pct),velocityUnits::pct);//
But that is when they are individual motors. Not “drivetrains.”
How do i code an arcade control joystick “drivetrain”?


Edit: I mean tank drive not arcade. Sorry.

Three things:

  1. The code you provided is a tank drive, do you want a tank drive, or arcade drive?
  2. Do not use “Drivetrain” you lose most of the functions of the motor.
  3. For achade controls without “Drivetrain”:
    Right motor is joystick 2 minus joystick 3
    Left motor is joystick 2 plus joystick 3
1 Like

I wanted to use “drivetrain” because of the easy gyro integration in auton. How can I use Gyro for precise turns and straights in auton withouth the “drivetrain”?


If you go to File > Open Examples there is an example called ‘Accurate Turns’ under the ‘Sensing’ section. This example gives you an example of how to use the Gyro to make 90 degreee turns without using the DriveTrain object:


1 Like