Quote:
|
Originally Posted by SeanCassidy
I wrote a function like this to find what buttons where what on the joystick (The same joystick first gave us.)
Code:
void Default_Routine(void)
{
if(!p1_x)
printf("p1_x\n");
if(!p1_y)
printf("p1_y\n");
if(!p2_y)
printf("p2_y\n");
if(!p1_wheel)
printf("p1_wheel\n");
if(!p1_aux)
printf("p1_aux\n");
if(p1_sw_trig)
printf("p1_sw_trig\n");
if(p1_sw_top)
printf("p1_sw_top\n");
if(p1_sw_aux1)
printf("p1_sw_aux1\n");
if(p1_sw_aux2)
printf("p1_sw_aux2\n");
}
What I couldn't find on the joystick themselves were p1_wheel, and p1_aux. Also, when I pressed the hat in different directions, nothing happened. Any ideas?
|
well, the hat control *should* be showing up as p1_wheel, and p1_aux is not used on the new joysticks.
also, most of the values are not boolean values - that is, you can't really use an if statement to check them. for instance, the wheel will never show up, because it is a analog value from 0-255, but in the case of the hat it is never 0 - it's neutral value is somewhat above zero. Same goes for the joystick x and y axis - they are analog values from 0-255.