Go to Post It'll take some engineering, but you would have yourself something revoloutionary. Keep innovating! - Greg Perkins [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 14-02-2008, 12:34
jfrank's Avatar
jfrank jfrank is offline
Registered User
FRC #2668
 
Join Date: Jan 2008
Location: Schwenksville
Posts: 10
jfrank is an unknown quantity at this point
Question joysticks

if you are going to use two or more joysticks how do you define the second joystick's "buttons"

how do you make / change definitions of "buttons" on the joystick(s)

EX: top, fire, etc...


ps.

model # P-35221
gamepro gear
prostick
  #2   Spotlight this post!  
Unread 14-02-2008, 12:37
laultima laultima is offline
Registered User
FRC #1458 (Danvillans)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2005
Location: Danville, CA
Posts: 87
laultima is on a distinguished road
Send a message via AIM to laultima
Re: joysticks

The seconds joystick buttons are the same as on the first, except instead of p1(ex. p1_sw_trig for trigger) its p2 (ex. p2_sw_top). If your saying you want to make your own definition for them, use define. At the top of your file, put #define port1_trig p1_sw_trig;
When you put code in using port1_trig, it will be the same as if you put in p1_sw_trig.
__________________
2007 Davis/Sacramento Regional Winner (100, 997, 1458)

2008 Davis/Sacramento Regional Gracious Professionalism Award Winner

  #3   Spotlight this post!  
Unread 14-02-2008, 12:47
jfrank's Avatar
jfrank jfrank is offline
Registered User
FRC #2668
 
Join Date: Jan 2008
Location: Schwenksville
Posts: 10
jfrank is an unknown quantity at this point
Cool Re: joysticks

thanks, but how to you make a new definition if a button was never defined in the first place?

Last edited by jfrank : 14-02-2008 at 12:57.
  #4   Spotlight this post!  
Unread 14-02-2008, 13:03
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: joysticks

I suspect you may be using EasyC Pro and the answers for that are quite different than the answers given here for MPLAB.

In MPLAB all the joystick buttons (and more) are already defined for every Operator Interface joystick port.
For example, all the joystick triggers are:
p1_sw_trig
p2_sw_trig
p3_sw_trig
p4_sw_trig
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 14-02-2008 at 13:09.
  #5   Spotlight this post!  
Unread 14-02-2008, 13:09
pheadxdll pheadxdll is offline
Registered User
AKA: Alex
FRC #1225 (Amperage Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: North Carolina
Posts: 168
pheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud of
Re: joysticks

Quote:
Originally Posted by jfrank View Post
thanks, but how to you make a new definition if a button was never defined in the first place?
All the definitons to inputs are made in ifi_alliases.h. Take a took in there and add another definition if you want. Available ports are already defined though.
__________________
Amperage Robotics Team 1225
Site under-going revamp. :/
  #6   Spotlight this post!  
Unread 14-02-2008, 13:13
laultima laultima is offline
Registered User
FRC #1458 (Danvillans)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2005
Location: Danville, CA
Posts: 87
laultima is on a distinguished road
Send a message via AIM to laultima
Re: joysticks

Quote:
Originally Posted by pheadxdll View Post
All the definitons to inputs are made in ifi_alliases.h. Take a took in there and add another definition if you want. Available ports are already defined though.
I suspect thats what the original question was. Thanks for clearing it up
__________________
2007 Davis/Sacramento Regional Winner (100, 997, 1458)

2008 Davis/Sacramento Regional Gracious Professionalism Award Winner

  #7   Spotlight this post!  
Unread 14-02-2008, 13:44
RyanW RyanW is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: MD
Posts: 40
RyanW has a spectacular aura aboutRyanW has a spectacular aura about
Re: joysticks

I believe all of the pins on the OI ports already have some sort of definition...
To see what names are given to different pins, you could check here.
If you're using the USB chicklet, I think you have to tell it what buttons you want corresponding to what...there should be instructions for that specifically, though.
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
Joysticks.... Moloch Control System 12 11-03-2005 20:58
Joysticks LBK Rules Control System 2 12-01-2005 20:38
AVB joysticks..and other analogue joysticks tml240 Kit & Additional Hardware 6 07-02-2004 12:45
joysTICKS edomus Control System 7 01-02-2004 00:51
Joysticks Neal Probert Technical Discussion 16 08-01-2003 21:59


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

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