Split Mode

Hiiii! I’m coding the controls for the controller with our robot. We are using the V5 controller, but I have a problem.

My team wants the program to be in split mode. According to my team members, that is when axis 3 controls both the left and right drive. Split also means that axis 1 controls the turning of the robot.

Here is my driver control code. I have gotten the robot to move forward and backward using only axis 3, but the robot isn’t turning. Like, AT ALL.

Here is my code;

    LeftDrive.spin(vex::directionType::fwd, Controller1.Axis1.value(), vex::velocityUnits::pct); //(Axis3+Axis4)/     
    RightDrive.spin(vex::directionType::rev, Controller1.Axis3.value(), vex::velocityUnits::pct);//(Axis3-Axis4)/2
    
    LeftDrive.spin(vex::directionType::fwd, Controller1.Axis3.value(), vex::velocityUnits::pct); //(Axis3+Axis4)/     
    RightDrive.spin(vex::directionType::rev, Controller1.Axis3.value(), vex::velocityUnits::pct);//(Axis3-Axis4)/2

Before anybody tries to answer this question, I need to give a few disclaimers:
-Neither motor is reversed
-There is other code, but it’s not important in this case
-I am using VEX Text now

Thanks, and I hope you can assist me!!!

I see two issues here. Firstly, RightDrive is controlled by axis3 in both statements. I believe the first time that should be axis 1.

Second, you have two statements for each motor, meaning the first pair of statements is overwritten by the axis 3 value immediately after axis 1 sets it. That’s why you can only go back and forth.
You’ll need to do it all in one statement like this:
LeftDrive.spin(vex::directionType::fwd, Controller1.Axis3.value() - Controller1.Axis1.value(), vex::velocityUnits::pct);

I may have my signs backwards, I’m not sure…
Essentially you just need to take the default arcade code (which judging by your comments you were already using) and replace ‘Axis4’ with ‘Axis 1’

1 Like

I fixed the code that I’ve written. I’ll try it out tomorrow on the robot. Hopefully, it’ll work! Thanks so much!