View Single Post
  #4   Spotlight this post!  
Unread 19-02-2004, 21:12
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Changing 1 joystick code to 2 (rookie team)

Quote:
Originally Posted by Brawler006
We are a rookie team and we have noobies working on the C code.
We see the code for 1 joystick drive i.e.

/*---------- 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);

etc....

This is a 4 motor robot and we need one joystick to control the left side and a second joystick to control the right side.
HELP US PLEASE!!!! WE HAVE NO IDEA WHAT WE ARE DOING!!!

Thanks,
A Rookie Team
Code:
pwm13 = pwm14 = p1_y;
  pwm15 = pwm16 = p2_y;
Now, the joystick going into Port 1 of the OI will control your left motors and the joystick into port 2 will control the right motors.. assuming of course that the left motors are plugged into pwm13 and pwm14, and the right motors are plugged into pwm15 and pwm16. That help you out any? Two joystick drive is usually just a direct output from the joystick to the PWMs.. its the one stick code that takes a bit of work.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003