In RobotC, what you want would be ~8 lines of actual code I think.
And yes, you can easily control 3 ports with one stick (or button).
Even the default program does this, mapping ports 1 and 7 together and 2 and 8 (hopefully I got the pairing right, it is easy to figure out at least).
#pragma config(Motor, port1, Motor1, tmotorNormal)
#pragma config(Motor, port2, Motor2, tmotorNormal)
#pragma config(Motor, port3, Motor3, tmotorNormal)
#pragma config(Motor, port4, Motor4, tmotorNormal)
#pragma config(Motor, port4, Motor5, tmotorNormal)
#pragma config(Motor, port4, Motor6, tmotorNormal)
#pragma config(Motor, port7, Motor7, tmotorNormal)
#pragma config(Motor, port8, Motor8, tmotorNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
// Maybe you'd need this?
bMotorFlippedMode[Motor1] = 1;
bMotorFlippedMode[Motor2] = 1;
bVexAutonomousMode = false;
while(true)
{
// Drive motors, perhaps
motor[Motor1] = vexRT[Ch3];
motor[Motor2] = vexRT[Ch3];
motor[Motor3] = vexRT[Ch1];
motor[Motor4] = vexRT[Ch1];
// Some other motors.
motor[Motor5] = vexRT[Ch1Xmtr2];
motor[Motor6] = vexRT[Ch1Xmtr2];
motor[Motor7] = vexRT[Ch1Xmtr2];
motor[Motor8] = vexRT[Ch2Xmtr2];
}
}
I think something like the above would work, but I haven’t tested it (it does compile, at least). If you aren’t using 2 motors for each side’s drive, then you could of course re-map those motors to something else (shifting, you said?)
I actually prefer the following for controlling a tank robot with 1 stick, it makes things much nicer.
motor[leftMotor1] = vexRT[Ch3] + vexRT[Ch4];
motor[rightMotor1] = vexRT[Ch3] - vexRT[Ch4];
motor[leftMotor2] = vexRT[Ch3] + vexRT[Ch4];
motor[rightMotor2] = vexRT[Ch3] - vexRT[Ch4];