Go to Post Before anyone accuses FIRST of being in the pocket of the sponsoring corporations, they might spend a minute and a half to actually apply some of that critical analytical ability that we are supposed to be demonstrating as educated engineers. - dlavery [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 17-07-2006, 20:14
Eric W. Jones's Avatar
Eric W. Jones Eric W. Jones is offline
Rack & Roll, baby!
FRC #1646 (Precision Guessworks)
Team Role: Programmer
 
Join Date: Jun 2006
Rookie Year: 2006
Location: Lafayette, Indiana
Posts: 231
Eric W. Jones will become famous soon enoughEric W. Jones will become famous soon enough
Using auxiliary joystick buttons with IFI controller.

Does the FIRST controller recognize the auxiallry buttons on the joysticks provided in the kit; and, if so, what are they referred to in the code?
  #2   Spotlight this post!  
Unread 17-07-2006, 20:26
Kristian Calhoun's Avatar
Kristian Calhoun Kristian Calhoun is offline
Celebrating 20 years of 25
FRC #0025 (Raider Robotix)
Team Role: Mentor
 
Join Date: Oct 2005
Rookie Year: 2006
Location: No. Brunswick, NJ
Posts: 1,077
Kristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond reputeKristian Calhoun has a reputation beyond repute
Send a message via AIM to Kristian Calhoun
Re: Using auxiliary joystick buttons with IFI controller.

Are you talking about the trigger and top buttons?

If so, they're recognized by the port of the joystick which they're on. For example if you wanted to use the trigger button on the joystick plugged into port 1, you use p1_sw_trig , likewise the top button would be p1_sw_top .

Let me know if this helps.

-Kristian

EDIT: Whoops, I misread your post, you said auxiliary. Use p1_sw_aux or p1_sw_aux2 [just change the number of the port to the one you need].
__________________
Raider Robotix: Home | Twitter | Facebook | Instagram
Brunswick Eruption: Home | Twitter | Facebook

Last edited by Kristian Calhoun : 17-07-2006 at 20:32.
  #3   Spotlight this post!  
Unread 17-07-2006, 20:41
Eric W. Jones's Avatar
Eric W. Jones Eric W. Jones is offline
Rack & Roll, baby!
FRC #1646 (Precision Guessworks)
Team Role: Programmer
 
Join Date: Jun 2006
Rookie Year: 2006
Location: Lafayette, Indiana
Posts: 231
Eric W. Jones will become famous soon enoughEric W. Jones will become famous soon enough
Re: Using auxiliary joystick buttons with IFI controller.

This is very helpful. Thank you.
  #4   Spotlight this post!  
Unread 17-07-2006, 23:33
Pat Fairbank's Avatar
Pat Fairbank Pat Fairbank is offline
Circuit Breaker
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2001
Location: San Jose, CA
Posts: 2,131
Pat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond reputePat Fairbank has a reputation beyond repute
Send a message via MSN to Pat Fairbank
Re: Using auxiliary joystick buttons with IFI controller.

Also, the various positions of the hat switch (the big round clicky thing) manifest themselves as different analog values on either the p1_aux or p1_wheel variables (can't remember which).
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)

patfairbank.com
  #5   Spotlight this post!  
Unread 03-12-2006, 18:36
robind robind is offline
Registered User
FRC #0675
 
Join Date: Dec 2006
Location: Rohnert Park
Posts: 31
robind is an unknown quantity at this point
Re: Using auxiliary joystick buttons with IFI controller.

Does anyone have more details on what the values are for the hat switch?
  #6   Spotlight this post!  
Unread 03-12-2006, 19:21
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Using auxiliary joystick buttons with IFI controller.

Quote:
Originally Posted by robind
Does anyone have more details on what the values are for the hat switch?
From ifi_aliases.h

PHP Code:
/*
 *-----------------------------------------------------------------------------------------------------
 *---------- Aliases for each OI analog input ---------------------------------------------------------
 *-----------------------------------------------------------------------------------------------------
 *  Below are aliases for the analog inputs located on the Operator Interface.
 */
#define p1_y        rxdata.oi_analog01
#define p2_y        rxdata.oi_analog02
#define p3_y        rxdata.oi_analog03
#define p4_y        rxdata.oi_analog04
#define p1_x        rxdata.oi_analog05
#define p2_x        rxdata.oi_analog06
#define p3_x        rxdata.oi_analog07
#define p4_x        rxdata.oi_analog08
#define p1_wheel    rxdata.oi_analog09
#define p2_wheel    rxdata.oi_analog10
#define p3_wheel    rxdata.oi_analog11
#define p4_wheel    rxdata.oi_analog12
#define p1_aux      rxdata.oi_analog13
#define p2_aux      rxdata.oi_analog14
#define p3_aux      rxdata.oi_analog15
#define p4_aux      rxdata.oi_analog16

/*
 *-----------------------------------------------------------------------------------------------------
 *---------- Aliases for each OI switch input ---------------------------------------------------------
 *-----------------------------------------------------------------------------------------------------
 *  Below are aliases for the digital inputs located on the Operator Interface.
 *  Ports 1 & 3 have their inputs duplicated in ports 4 & 2 respectively.  The 
 *  inputs from ports 1 & 3 may be disabled via the 'Disable' dip switch 
 *  located on the Operator Interface.  See Users Manual for details.
 */
#define p1_sw_trig  rxdata.oi_swA_byte.bitselect.bit0 /* Joystick Trigger Button, same as Port4 pin5 */
#define p1_sw_top   rxdata.oi_swA_byte.bitselect.bit1 /* Joystick Top Button,     same as Port4 pin8 */
#define p1_sw_aux1  rxdata.oi_swA_byte.bitselect.bit2 /* Aux input,               same as Port4 pin9 */
#define p1_sw_aux2  rxdata.oi_swA_byte.bitselect.bit3 /* Aux input,               same as Port4 pin15*/

#define p3_sw_trig  rxdata.oi_swA_byte.bitselect.bit4 /* Joystick Trigger Button, same as Port2 pin5 */
#define p3_sw_top   rxdata.oi_swA_byte.bitselect.bit5 /* Joystick Top Button,     same as Port2 pin8 */
#define p3_sw_aux1  rxdata.oi_swA_byte.bitselect.bit6 /* Aux input,               same as Port2 pin9 */
#define p3_sw_aux2  rxdata.oi_swA_byte.bitselect.bit7 /* Aux input,               same as Port2 pin15*/

#define p2_sw_trig  rxdata.oi_swB_byte.bitselect.bit0 /* Joystick Trigger Button*/
#define p2_sw_top   rxdata.oi_swB_byte.bitselect.bit1 /* Joystick Top Button*/
#define p2_sw_aux1  rxdata.oi_swB_byte.bitselect.bit2 /* Aux input*/
#define p2_sw_aux2  rxdata.oi_swB_byte.bitselect.bit3 /* Aux input*/

#define p4_sw_trig  rxdata.oi_swB_byte.bitselect.bit4 /* Joystick Trigger Button*/
#define p4_sw_top   rxdata.oi_swB_byte.bitselect.bit5 /* Joystick Top Button*/
#define p4_sw_aux1  rxdata.oi_swB_byte.bitselect.bit6 /* Aux input*/
#define p4_sw_aux2  rxdata.oi_swB_byte.bitselect.bit7 /* Aux input*/ 
"_wheel" makes sense but have it output all the values with a simple printf and use the joystick (press buttons to change values, etc) so you can determine which variable it is.
  #7   Spotlight this post!  
Unread 03-12-2006, 19:24
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,030
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: Using auxiliary joystick buttons with IFI controller.

Quote:
Originally Posted by chris31
"_wheel" makes sense but have it output all the values with a simple printf and use the joystick (press buttons to change values, etc) so you can determine which variable it is.
This is not correct. "_wheel" is for the large wheel on the left hand side of the CH Flightstick (ie: not the trim wheels). I am not certain what the hat corresponds to, but my best guess would be the aux's, or the second joystick.

[edit]I just realized that you are talking about new sticks and I am talking about old sticks. See Astronouth's post below me for information about the new joysticks.[/edit]

You see, back in the day, two joysticks could be hooked to each gameport port. Some hardware manufacturers, rather than building an entire second joystick, just put in some circuitry to send "full up/down/left/right" instead of the analog values. This let you map the second joystick to a D-pad, for instance.

However, on the IFI implementation of the Gameport, the "_wheel" variable uses one of the analog axes of the second joystick, and the "_aux" variable the other analog axis. This still leaves the two remaining digital variables of "_aux1" and "_aux2". It is possible that the up/down or left/right gets mapped "full up/down" to "_aux" and the other is mapped to "_aux1" and "_aux2".

Sorry if my explanation now doesn't make a tremendous amount of sense. I am going to be writing all of this up much more clearly before build season.

Last edited by Greg Marra : 03-12-2006 at 19:40.
  #8   Spotlight this post!  
Unread 03-12-2006, 19:24
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: Using auxiliary joystick buttons with IFI controller.

Quote:
Originally Posted by robind
Does anyone have more details on what the values are for the hat switch?
Ok, I won't chew you out for not searching, since I had to dig deep to find them, and I knew what I was looking for.

See http://www.chiefdelphi.com/forums/sh...655#post212681

Just be warned that that was back in 2004, when they first came out. There's a good chance they've changed, knowing how good of joysticks they are.
  #9   Spotlight this post!  
Unread 03-12-2006, 19:33
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,270
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Using auxiliary joystick buttons with IFI controller.

Quote:
Originally Posted by robind
Does anyone have more details on what the values are for the hat switch?
Download the Dash board from ifi and use that to check the buttons.

Also remember that the even ports have pins to use for the switches of the odd port on the opposite side, so if you put in custom switches makes sure you aren't using them for more than one thing. Programmers should know the OI reference guide and the RC reference guide and the victor reference guide and every thing about the cmu-cam

Those documents will save you hours during build season, and are extremely important for trouble shooting electronics and programming.

James
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #10   Spotlight this post!  
Unread 03-12-2006, 22:26
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: Using auxiliary joystick buttons with IFI controller.

Hey!

I just recently too just found out the values for the p1_wheel. If you are still interested send me a private message. That link you sent seems helpful if you noe Base 2 (binary). But i noe them in Base10 (normal decimal). let me noe.
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
Using IFI Controller witout Operator System 703pascal Programming 20 16-06-2007 22:10
Programming motors with joystick buttons TMHStitans Programming 5 21-03-2005 21:07
Victors controlled with joystick Buttons JamesBrown Programming 2 18-02-2005 23:39
Using the extra buttons on the joystick. Code\\Pilot Programming 7 04-12-2004 19:30
problem with joystick buttons (top left one) Richomundo Programming 5 15-02-2004 17:16


All times are GMT -5. The time now is 22:09.

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