How to program Arcane Drive?

Im trying to figure out how to program arcane drive and cant figure out how to do it. What im trying to do is be able to turn while driving using one of the control stick. I am using the C++ version so the block code will not help

If you wanted, you could make the code in blocks, then translate to C++. Also, what drive are you using?

If it is a four motor or two motor (e.g. you have set the drivetrain as a device), you can follow these steps:

  1. Add the Controller
  2. Click the controller stick three times till you see this:
    image
    The right stick is to turn and the left stick moves forward/backwards

I’m using x chasis so I don’t think that will work

you are going to need to program the drive yourself, here is an example of what you could do, (this would be in the while loop in driver control)

    R1 = Controller1.Axis3.value() - Controller1.Axis1.value() - Controller1.Axis4.value();
    R2 = Controller1.Axis3.value() - Controller1.Axis1.value() + Controller1.Axis4.value();
    L1 = Controller1.Axis3.value() + Controller1.Axis1.value() + Controller1.Axis4.value();
    L2 = Controller1.Axis3.value() + Controller1.Axis1.value() - Controller1.Axis4.value();

    Right.spin(forward, R1, percent);
    Right2.spin(forward, R2, percent);
    Left.spin(forward, L1, percent);
    Left2.spin(forward, L2, percent);

(right is front right motor, right 2 is back right motor, etc.)

this is older code of mine, so i cant quite remember exactly which stick did what, but I’m 90% confident that it was forward movement is axis 3, sideways movement was axis 4, and turning was axis 1.

1 Like