What should we use as code for x drive?

My team needs the fundamentals to know how to code x drive. Anything would be helpful.

https://www.vexforum.com/search?expanded=true&q=how%20to%20code%20an%20x%20drive

10 Likes

Try this. It’s in vex code pro but you could easily convert it if you wanted to.

// Drive Train Settings
    Rfront.setVelocity((Controller1.Axis2.position() - (Controller1.Axis1.position() + Controller1.Axis4.position())), percent);
    Lfront.setVelocity((Controller1.Axis2.position() + (Controller1.Axis1.position() + Controller1.Axis4.position())), percent);
    Rback.setVelocity((Controller1.Axis2.position() + (Controller1.Axis1.position() - Controller1.Axis4.position())), percent);
    Lback.setVelocity((Controller1.Axis2.position() - (Controller1.Axis1.position() - Controller1.Axis4.position())), percent);
    Rfront.spin(forward);
    Lfront.spin(forward);
    Rback.spin(forward);
    Lback.spin(forward);
1 Like

I will try it thank you.