Hi, someone knows how to program a template with robotC in which the robot can be controlled with two controllers?
Thanks for the info
I agree, someone does… ME!
To change a control to the second controller, add “Xmtr2” to the end of the channel or button.
ex:
On the first controller
motor[port1]=vexRT[Ch2];
motor[port2]=vexRT[Btn6U]*127;
On the second controller
motor[port1]=vexRT[Ch2Xmtr2];
motor[port2]=vexRT[Btn6UXmtr2]*127;
Hope this helps, and is what you are looking for!
Add “Xmtr2” to the end of each channel or button
Ex:
vexRT[Ch2Xmtr2];
vexRT[Btn6Xmtr2];
Make sure that your joysticks are connected by a partner cable.
Or if you are using a PIC controller, make sure you have 2 crystals plugged in to the microcontroller.
I was too slow.
There is no template for this. Just put an Xmtr2 after the channel or button controlling what you want to move.
So if I were trying to make the port 1 motor move on the second controller on Channel 2:
motor[port1] = vexRT[Ch2Xmtr2] ;
would do the trick.
Here is the general page explaining how to access every input on either controller.
http://www.robotc.net/wikiarchive/VEX2_Functions_Remote_Control_-_VEXnet
Also the RobotC API is worth a read through as it has pretty good explanations on other things like functions, tasks etc.