How to program standard 4 motor drive as 2 motor groups for autonomous

I use vexcode v5 blocks, do you think you could help me figure out how to program standard 4 motor drive as 2 motor groups?

Yes. Go into the configuration window. Click “add device” and then click “add motor group”. The rest should be obvious. You will not, however be able to refer to your drivetrain as “drivetrain”, any more but only as 2 separate motor groups. If you want to do that try using VexCode V5 PRO. It’s very easy to learn and it gives you a lot more control over what you can do with your robot. Good Luck

2 Likes

I don’t want to give the whole code away, but I would make a LeftDrive motor group and a RightDrive motor group. You will also want to initialize a controller.

Then use if statements to determine which direction you want the wheels to turn based on what the joystick is doing (in the sensing group of blocks).

Here is how you should start it:

I used -10 as a deadzone so that you don’t get controller drift. Also this would be for tank drive. You would then need to replicate this code for the positive direction on left and then positive and negative direction on the right. Lastly you would need to stop the drives when the joysticks are not being used, I use the “not” operator with 4 “and” operators for that.

Let me know if you need more help.

2 Likes

@Zack_Helgesen is right but I think there is an easier way to do it. I’m not very good at explaining things but if you start with:

if abs of Controller1, 3Position > or< 5
then set LeftSide to Controller1, 3Position
LeftSide spin Forward

and similar for the right side. In other words, you want to tell the sides how fast to go, and then tell them that they should go. Plus you don’t need to do the same for reverse because the joystick axes will set the speed to negative. Sorry if I sound confusing. I can always post a screenshot of what I mean if you want.

3 Likes

This works. We are doing the same thing.

1 Like

sorry to bother, but how would my team do this for auton because we have it for controller, but we want to use it for auton so one side goes forward and the other stays in place without moving essentially turning, but with one specific side only

If you want to turn in place, run one side forward and the other backward.