Vex V5 6 Motor Drive Train

I’m new to c++ and am wondering if I have this code configured properly. There isn’t ant driving code as of right now, I’m just trying to see if it’s set up right.

//All Motors

vex::motor RightFront = vex::motor( vex::PORT20, false);

vex::motor RightMiddle = vex::motor( vex::PORT19, false);

vex::motor RightBack = vex::motor( vex::PORT18, false);

vex::motor LeftFront = vex::motor( vex::PORT1, false);

vex::motor LeftMiddle = vex::motor( vex::PORT2, false);

vex::motor LeftBack = vex::motor( vex::PORT3, false);


vex::motor_group Right = vex::motor_group(RightFront, RightMiddle, RightBack);

vex::motor_group Left = vex::motor_group(LeftFront, LeftMiddle, LeftBack);


const int wheelTravel = 12;

const int trackWidth = 16;

const int wheelBase = 16;

const double gearRatio = 4.2;


vex::drivetrain RoboDrive = vex::drivetrain(Left, Right, wheelTravel, trackWidth, wheelBase, distanceUnits::in, gearRatio);


vex::controller Controller1 = vex::controller();

1 Like

Looks about right. I would change Left and Right to be LeftSide and RightSide, helps readability.

That’s some documentation on drivetrain API, for anyone reading this wanting to know how to configure it, plus decent explanations

1 Like

The most up to date API reference is available here:


Wow I never even saw that, thank you