Coding Arcade Drive

Hello, my team and I are wanting to transition to an arcade drive with our most recent robot (4-motor drive). We have been driving with two joysticks and don’t have any trouble coding that. I attempted on creating an arcade drive program but I can only drive forward and backwards and side to side but not diagonally with one joystick. Any help on how to code an arcade drive would be really helpful. Thanks!

I don’t use VCS or VEXcode, so my syntax might be a bit off, but it would be something like this:

driveFrontLeft.spin(vex::directionType::fwd, (Controller.Axis3.value() + Controller.Axis4.value()), vex::velocityUnits::pct);
driveBackLeft.spin(vex::directionType::fwd, (Controller.Axis3.value() + Controller.Axis4.value()), vex::velocityUnits::pct);
driveFrontRight.spin(vex::directionType::fwd, (Controller.Axis3.value() - Controller.Axis4.value()), vex::velocityUnits::pct);
driveBackRight.spin(vex::directionType::fwd, (Controller.Axis3.value() - Controller.Axis4.value()), vex::velocityUnits::pct);

As an aside, since you posted this in the VCS Tech Support category, I would recommend switching to VEXcode if you haven’t already. VCS isn’t supported anymore and is a pain to work with in general.

Edit: I assumed you wanted to use the left joystick, if instead you wished to use the right, switch Axis3 with Axis2 and Axis4 with Axis1 respectively.

1 Like