VEX V5 controller left joystick controlling left side of the robot

I want the left joystick to control the left side of the robot (left two wheels) and the right joystick to control the right side of the robot (right two wheels), but I’m not really sure how to code that. Does anyone know how to program that in python?

If you are using vexcode, you can configure that in the devices menu by clicking on the joysticks (you can do multiple times for different types of drives).

Based on your description, this is called tank drive.

I won’t directly give the code, as you have to do it yourself, but this is how it works:

The Left Side spins by the amount of change in the vertical left joystick relative to the center, and the same goes for the Right Side.

You can get the joystick values by:

Controller.Axis1.value()
1 Like

Expounding on what @J.4 said, you could also do variables if you don’t want to use the menu. Make sure to set up your motors before.

left_wheels_power = controller.Axis3.value();
right_wheels_power = controller.Axis2.value();
leftMotors.set_velocity("left variable");
rightMotors.set_velocity("right variable")
1 Like