Log in

View Full Version : FRC default code


hedgehogger
21-01-2004, 17:48
On the FRC default program is it programmed for one or two controllers to begin with???
-Hedgehogger

mtrawls
21-01-2004, 18:38
On the FRC default program is it programmed for one or two controllers to begin with???
-Hedgehogger


Perhaps this little chunk of code from user_routines.c will answer your question:


/*---------- 1 Joystick Drive ----------------------------------------------
*--------------------------------------------------------------------------
* This code mixes the Y and X axis on Port 1 to allow one joystick drive.
* Joystick forward = Robot forward
* Joystick backward = Robot backward
* Joystick right = Robot rotates right
* Joystick left = Robot rotates left
* Connect the right drive motors to PWM13 and/or PWM14 on the RC.
* Connect the left drive motors to PWM15 and/or PWM16 on the RC.
*/
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);

jweric
21-01-2004, 18:41
It also is able to do so with 2 joysticks as well, if you would look at where the PWM declorations above it a bit, I forget the lne numbers. You would use PWM outputs 1 and 2