How should I program six motor drive using c++, just added it for regionals
The best option would be to use motor groups.
Vexcode api:
https://api.vexcode.cloud/v5/class/classvex_1_1motor__group
Forum post with example code:
IMO I feel like the option above restricts what you can do in the future. You have a lot more flexibility programming each motor individually, especially considering a 6 motor drivetrain.
Here is the controller layout:
With this in mind, also knowing that VEX motors have voltage from -12.0 to 12.0, with controllers values range from -100 to 100:
int forward;
int turning;
int left_side;
int right_side;
double left_side_volts;
double right_side_volts;
while(true){
//////////////////////////////////////////////////////////////
// Drivetrain Code - Split Arcade
//////////////////////////////////////////////////////////////
forward = Controller1.Axis3.value();
turning = Controller1.Axis1.value();
left_side = forward + turning;
right_side = forward - turning;
left_side_volts = 12.0 * (left_side / 100.0);
right_side_volts = 12.0 * (right_side / 100.0);
Left1.spin(fwd, left_side_volts, voltageUnits::volt);
Left2.spin(fwd, left_side_volts, voltageUnits::volt);
Left3.spin(fwd, left_side_volts, voltageUnits::volt);
Right1.spin(fwd, right_side_volts, voltageUnits::volt);
Right2.spin(fwd, right_side_volts, voltageUnits::volt);
Right3.spin(fwd, right_side_volts, voltageUnits::volt);
vex::task::sleep(20);
}
Yes, that will work. It’s probably better to use voltage instead of percent, but this is fine.
Just wondering, how do motor groups restrict what you can do? And what things can you do with individual motors that you can’t with motor groups?

