How do I program a Y cable

Hello, I am trying to program my robot using a Y cable. Except I don’t have a clue where to start. I want to know how to program a Y cable into a remote control program for a joystick program and a button program. Thank you.

y cables do not need to be specifically programmed. The 2 motors that are on the y split will do whatever behavior is programmed for the port they are plugged in

For example, if you y split port 3 and you have port 3 programmed to give power when you push a button on the controller, both motors that are on that y split get power when you push the button. Its like pretending that motor is just the same as all the others. Y splitting really only changes the wiring. If you have 2 things that are y split that need to move in opposite directions then you need to plug one of the motors into the motor controller backwards (red to black) so it goes in the opposite direction when it gets power.

Then what about the joystick, would that be the same.

Yup. Its all the same.

Do you have an example sorry I am still trying to learn how to program a button control program.lol

For a button it would look something like this:
if ( vexRT[Btn6U] == 1 )
{
motor[armL] = 127;
motor[armR] =127;
}

Ok that makes sense then for a joystick what would that look like. :slight_smile:

For a Joystick it would look something like this:

motor[driveL] = vexRT[Ch4];

task main()
{
while(true)

motor[rightbackside]=vexRT[Ch2];
motor[leftbackside]=vexRT[Ch3];
motor[frontandrightbase]=vexRT[Ch2]+vexRT[Ch3];

}

This is what I have now but only the right side is working, why is that.

OK, so when using a Y-cable, you do not have to change anything whatsoever in the program from a single motor being powered. I want to emphasize this so I’ll say it again. You do not have to change anything whatsoever in the program. Say you are using a Y-cable for two of the motors in port 2. Now, if you power port 2 in the program, both of the motors in that Y-cable will be powered.

For a button: Port 2 has a Y-cable

if(vexRT[Btn5U] == 1) {
           motor[port2] = 100;
}

This will power both motors in port 2.

For a joystick: Port 2 has a Y-cable


motor[port2] = vexRT[Ch3];

Ok thank you so much.

No problem and if you ever have a question, especially about programming, feel free to ask. Good luck with your adventure with Y-cables!