Programming Extra Joystick Buttons

I just had a question about how the joystick buttons are programmed. We’re using a joystick that has more buttons than the default code has assigned. I was looking at how they’re assigned, and just wanted to know if the “bit#” at the end of the RC feedback variable corresponds to the pin on the connector. In other words, say the button I want to assign uses pin 14 of the connector, would that be “xx.xxxxxx.bit14”? If not, how would I be able to figure out the bit value?

The OI Reference Guide availible from http://ifirobotics.com/oi.shtml shows the pinouts of the joystick ports and the appropriate variables on pages 7-10.

The ones listed are the only ones connected. If you have a joystick with switches on other pins, you will have to make your own adapter so that they map to the correct pins.

And a lot of this depends on the joystick. I have a CH FighterStick Pro that has 16 buttons on it, but each of them is mapped to a combination of the four available buttons on the OI pin, so you can write a simple state machine mapping these buttons to 16 separate states (as long as you are comfortable with not being able to have two buttons pressed at the same time).

In any case, each OI port only allows 4 switch inputs. To get more, you need to either wire to other ports, or make a circuit that encodes the extra switchs as analog inputs (this is how the USB Chicklet handles extra buttons, for example).