I’m having a difficult time writing a program for my robot. It has four wheels and each one is powered by a motor with a few gears. How can I make it so each side is controlled by one of the joysticks?
Pretty simple, because the joystick readings go from -127 to 127 and the powers you set the motors to also go from -127 to 127, you simply set the motors to the joystick value. Then put it all in a loop that repeats so that it constantly updates.
Just change the joystick channels and motor ports to whatever is applicable.
while (true)
{
motor[1] = vexRT[Ch1]; //left side
motor[2] = vexRT[Ch1];
motor[3] = vexRT[Ch2]; //right side
motor[4] = vexRT[Ch2];
}
I’d also recommend nosing around in the sample programs folders. You’ll be able to find what you want to do here and tons more, both to use and see how things are done. If you want to modify a sample code just remember to save as a new copy.