Go to Post Messy wires are a pain in the chassis - [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-2006, 15:50
team 803 team 803 is offline
Wow! a whole week1/2 of experience
FTC #0803 (Hawks)
Team Role: Programmer
 
Join Date: Feb 2006
Location: Hanahan SC
Posts: 37
team 803 is an unknown quantity at this point
Joystick Programming

In the file where it shows the joystick controls, I have tried different arrangements so that one joystick will control all of the wheels, but the program lines that it had devoted to this in the file does not work.
I need it so that when lean the joystick left the right wheels go forward while the left go back and Vice-versa, can anybody give me a code that will do this.

I have tried to make one myself, but they don't work.
__________________
"Vir prudens non contra ventum mingit"
"Machina improba! Vel mihi ede potum vel mihi redde nummos meos!"
  #2   Spotlight this post!  
Unread 19-02-2006, 15:55
team 803 team 803 is offline
Wow! a whole week1/2 of experience
FTC #0803 (Hawks)
Team Role: Programmer
 
Join Date: Feb 2006
Location: Hanahan SC
Posts: 37
team 803 is an unknown quantity at this point
Re: Joystick Programming

pwm01 = p1_y;
pwm02 = p2_y;
pwm03 = p3_y;
pwm04 = p4_y;
pwm05 = p1_x;
pwm06 = p2_x;
pwm07 = p3_x;
pwm08 = p4_x;


01 will be the right while 02 will be the left, how do I set that up so that one will reverse while the other goes forward (as described above)?
__________________
"Vir prudens non contra ventum mingit"
"Machina improba! Vel mihi ede potum vel mihi redde nummos meos!"
  #3   Spotlight this post!  
Unread 19-02-2006, 16:12
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Re: Joystick Programming

copied from innovation first's 2006 default programming

Code:
  pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);
  pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127);
If you dont want to use 13,14,15,16 change 13,14 to 01 and 15,16 to 02 and

Code:
  //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;
That should map the joystick movement to one stick drive.

-Mike
  #4   Spotlight this post!  
Unread 19-02-2006, 16:17
Hieb Hieb is offline
Registered User
no team
Team Role: Teacher
 
Join Date: Mar 2004
Rookie Year: 2004
Location: St. Louis, MO
Posts: 125
Hieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to beholdHieb is a splendid one to behold
Re: Joystick Programming

If you are using the default code and want 1 joystick drive, make sure your right motors are in pwm13/pwm14 and that your left motors are in pwm15/pwm16.
  #5   Spotlight this post!  
Unread 21-02-2006, 07:54
team 803 team 803 is offline
Wow! a whole week1/2 of experience
FTC #0803 (Hawks)
Team Role: Programmer
 
Join Date: Feb 2006
Location: Hanahan SC
Posts: 37
team 803 is an unknown quantity at this point
Re: Joystick Programming

One detail I forgot, the left motors are connected through one wire and the same with the right.
__________________
"Vir prudens non contra ventum mingit"
"Machina improba! Vel mihi ede potum vel mihi redde nummos meos!"
  #6   Spotlight this post!  
Unread 21-02-2006, 11:33
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Joystick Programming

That's perfectly fine. You don't need to use both 13 and 14, or both 15 and 16. Just one or the other. 13 and 14 are exactly the same, as are 15 and 16.
__________________
Code:
void function(void)
 {
  function();
 }
  #7   Spotlight this post!  
Unread 21-02-2006, 11:49
team 803 team 803 is offline
Wow! a whole week1/2 of experience
FTC #0803 (Hawks)
Team Role: Programmer
 
Join Date: Feb 2006
Location: Hanahan SC
Posts: 37
team 803 is an unknown quantity at this point
Re: Joystick Programming

We are using the second stick for the launcher, I am not quite sure how to set that up (two weeks experience with programming). We need it so that when the top button is pressed, the motor starts. (I think that would be aux)
pwm 04
Then when the stick is pressed forward it moves the other motor forward and when moved backwards it goes backwards.
pwm 05
__________________
"Vir prudens non contra ventum mingit"
"Machina improba! Vel mihi ede potum vel mihi redde nummos meos!"
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
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Programming motors with joystick buttons TMHStitans Programming 5 21-03-2005 21:07
Joystick Button programming Bharat Nain Programming 5 18-02-2005 11:48
single joystick programming Bill Bonsky OCCRA 2 04-10-2003 09:47
Programming the second joystick in PBASIC archiver 2001 2 24-06-2002 00:25


All times are GMT -5. The time now is 03:20.

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