Quote:
|
Originally Posted by Code\\Pilot
Does anybody has an idea of how to use the extra buttons on the joystick?
Because the only bits mapped are the trigger bit and the top button bit.
And there is more buttons there that we could use.
Any ideas?
|
I know there are more buttons in the default code.. such as the hat switch and the 2 aux buttons next to the hat. (p1_aux1 & p1_aux2)
If you have another kind of joystick that isnt given by FIRST or working with the default code, you can find out how it works with a multimeter and a little bit of time.
First, find a Pin-out diagram for standard Game Port connectors. Set the multimeter to detect continuity and put one lead on the pin used for input voltage. Then hold down a button and put the other lead on pins until it beeps (or flashes.. depending on the meter). Repeat this for each button and make sure to write down what button connects to what pin. (use the voltage measuring feature to find which joystick axis connects to which pin)
Then, find the corresponding pins in the default code (look in "ifi_aliases.h" for the variable names of each pin) Then set an alias in your "user_routines.h" file. Could look something like this:
Code:
#alias MyJoystick1_SideButton rxdata.oi_swA_byte.bitselect.bit3