I need help programming my groups X-Drive

Ok so I am kinda a new programmer and my group went with a x-drive and i managed to get the main jist of it of like what the directions are but I don’t know how to put it to a analog control I’ve seen YouTube videos they haven’t helped me cuz I need a physical example like to kinda be taught to do it if you know how to help me all please do I need it (i would prefer to use the blocks cuz i don’t know python)

1 Like

Welcome to the forum. This is a common question, and has been answered several times on the forum. Like most sites, the forum search bar is not as good as using a google search directed to this url. I did a google search of “x-drive programming site:vexforum.com” which returned How can I code an X-drive as its top result.


I can’t give this to you in blocks but you can easily convert this into blocks. It’s in VexCode Pro, so if you know that just paste it in. There are no motor groups. Rfront etc. are motor names.

    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);
1 Like

Welcome to the forums, Like ulysses barth said, using that code will help in coding the x-dive, but you do need more than just that. Take a look at these examples, and if you need more help, feel free to post your code, or ask any question.

Motor Groups in Vex

Code for X drive

Block code and more

Code for X drive in VCS

This is for Mechanum wheels, but the principle is still the same

Hope this helps!

1 Like

So I put the program in and I troubleshooted some problems I had but I haven’t been able to get the program to run properly is there anything I am possibly doing wrong?

If I have a really bad problem like this, I open a blank program and copy and paste the part that isn’t working into it. in your case that would be the program I posted and the motor config. etc.
If you just have that it should work fine on its own. Also, is it in a forever loop? And how is it not working? Is it all backwards? Or does it not run at all…

Its not running at all but i fixed the problem and relized im just blind

Don’t worry. I do that all the time. :grinning: