Go to Post I bet if anyone took a look at the 118's Bill of Materials the only thing that would be on there is hard work and that's priceless. - rcmolloy [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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.
 


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 21:15.

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