V5 X Drive Pros Code

       int power  = master.get_analog(ANALOG_RIGHT_Y);
   int turn   = master.get_analog(ANALOG_RIGHT_X);
   int strafe = master.get_analog(ANALOG_LEFT_Y);

   int LF  = power + turn + strafe;
   int LB  = power + turn - strafe;
   int RF  = power - turn - strafe;
   int RB  = power - turn + strafe;

   LFDrive.move(LF);
   LBDrive.move(LB);
   RFDrive.move(RF);
   RBDrive.move(RB);

This is my Pros code for a 4 motor X Drive using V5. I currently do not have a V5 system to test this with. Would this code work for an X Drive, and if not what should I change?

2 Likes

Yes that should work

yeah it might.

20 charrrrrrrrr

What are the names of your motors?

what does this mean:
LFDrive.move(LF);
LBDrive.move(LB);
RFDrive.move(RF);
RBDrive.move(RB);

set the speed of LFDrive to the veritable LF. And so on for the 3 other motors.