View Single Post
  #45   Spotlight this post!  
Unread 08-02-2004, 19:21
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: New Joysticks...Good or Bad Choice by FIRST?

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.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)

Last edited by deltacoder1020 : 08-02-2004 at 19:23.