Hi. I have a four motor drivetrain, and I’m trying to code it in a way that both left and right motors go forward when you push just the left joystick forward, and backward and you push left joystick backward. For turning right and left, I want to have it so that it turns right when I push the right joystick right. Left when I push the right joystick left.
The reason I am trying to code this and not just use the drivetrain config is because I cannot set the turn or drivetrain velocity when I do that. I want to be able to set the velocity, while at the same time, have the control of the drivetrain config. I do blocks.
You can add a controller in VEXCode V5 and set the drive controls to what you want. Just click on any joystick (left or right) and keep clicking until you get the right controls you want.
Do you know why it wont let you change the velocity? Usually there is a “drivetrain velocity” block that you can use to change it, I’m not sure about the turning because I stopped doing block a while ago.
If you are using text coding, you can create a motor group and set its speed in your code while using the drivetrain configuration in VexCode.
I believe that it’s easier to code driver control with motor groups than drivetrain.
First question are you using text or block and what software are you using to code. Vexcode blocks, vexcode pro v5, vexcode extension for vs code, pros extension for vs code, etc.
You can use the Switch blocks to override the joystick controls. The turnRatio variable allows you to adjust your turn velocity without affecting the drive velocity.
I can’t test this because I am not near a brain but it should give you the concept. Make sure that you are not binding the joysticks in the Devices page. Other devices can be configured but nothing that is being controlled with code.
If you set up a drivetrain of 4 motors instead of connecting motors individually in vexcode, that allows you to do that with ease, as there are actual “drive forward” and “turn left/right” commands. Just connect a controller in vexcode and the rest should be easy you just have to know which joystick axes to use.