Log in

View Full Version : joysticks


jfrank
14-02-2008, 12:34
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

laultima
14-02-2008, 12:37
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.

jfrank
14-02-2008, 12:47
thanks, but how to you make a new definition if a button was never defined in the first place?

Mark McLeod
14-02-2008, 13:03
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

pheadxdll
14-02-2008, 13:09
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. :)

laultima
14-02-2008, 13:13
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

RyanW
14-02-2008, 13:44
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 (http://www.ifirobotics.com/docs/oi-ref-guide-5-8-07.pdf).
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.