Go to Post Someday, when I grow up, I want to join the GDC so I can make people go crazy, and then release hints that get people even crazier. - unionylibertad [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-02-2004, 21:03
Brawler006 Brawler006 is offline
Registered User
#1206 (Wrench Warriors)
 
Join Date: Nov 2003
Location: inside my head
Posts: 13
Brawler006 is an unknown quantity at this point
Exclamation Changing 1 joystick code to 2 (rookie team)

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
  #2   Spotlight this post!  
Unread 19-02-2004, 21:10
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
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
Ok i can help you. Just tell me what ports your joysticks are connected to and what PWMs your motors are connected to, and i'll tell you what to change.
__________________
1139 Alumni
  #3   Spotlight this post!  
Unread 19-02-2004, 21:10
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Changing 1 joystick code to 2 (rookie team)

in the default code, the outputs are mapped to:

pwm01 = p1_y;
pwm02 = p2_y;
pwm03 = p3_y;
pwm04 = p4_y;
pwm05 = p1_x;
pwm06 = p2_x;
pwm07 = p3_x;
pwm08 = p4_x;
pwm09 = p1_wheel;
pwm10 = p2_wheel;
pwm11 = p3_wheel;
pwm12 = p4_wheel;

so you could simply use the Y cables and put the two right motors on pwm01 and the two left motors on pwm02

or edit the code above to put the same signal on two outputs - if you want your right motors on pwm1 and pwm2 and your left motors on 3 and 4, change it to

pwm01 = p1_y;
pwm02 = p1_y;
pwm03 = p2_y;
pwm04 = p2_y;

BTW - this code is in the file user_routines.c - after you edit it you have to pull down the menu and 'make' your code (let it compile)

PS- make a backup copy of your default code somewhere first :^)

Last edited by KenWittlief : 19-02-2004 at 21:13.
  #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
  #5   Spotlight this post!  
Unread 20-02-2004, 16:30
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Changing 1 joystick code to 2 (rookie team)

ps- It's faster to compile by hitting F10, it won't recompile what you didn't change.
  #6   Spotlight this post!  
Unread 20-02-2004, 17:00
ChrisA's Avatar
ChrisA ChrisA is offline
Registered User
#0857 (Superior Roboworks)
Team Role: College Student
 
Join Date: Feb 2002
Location: Michigan Tech
Posts: 157
ChrisA is on a distinguished road
Send a message via AIM to ChrisA
Re: Changing 1 joystick code to 2 (rookie team)

This piece of code can be found already created in the default code in the user_routines.c file.

Code:
 /*---------- 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);
__________________
Programmer
----------------
Team#857
Superior Roboworks

WildStang Alum
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Am I the only person with this job? A. Leese General Forum 55 22-06-2006 20:10
The Death of FIRST Anton Abaya General Forum 23 03-05-2006 17:18
A ? about NASA grants computhief263 General Forum 18 29-03-2004 13:35
Novi Kickoff Seminar List (Tentative) Joe Johnson General Forum 1 05-12-2001 13:47


All times are GMT -5. The time now is 11:41.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi