Quote:
|
Originally Posted by Matt_Kitts
can anyone help me out with programming the buttons on the joy sticks`
|
Each OI joystick port has the 2005 KoP joystick buttons available in the default code as follows:
For Joystick Port 1:
- p1_sw_top - thumb button
- p1_sw_trig - trigger button
- p1_sw_aux1 - button to the left of the "hat" switch on the front face
- p1_sw_aux2 - button to the right of the "hat" switch on the front face
The other Port buttons follow the same naming convention, e.g.,
p2_sw_top would be on joystick Port 2, p3_sw_top on Port 3, etc.
They are used in your code like this:
Code:
if (p2_sw_top == 1)
printf("Hello FIRST\r");
else
printf("Goodbye cruel world\r");
There are also two analog inputs unused by the KoP joystick and the analog "hat" switch (that returns odd values).