View Single Post
  #4   Spotlight this post!  
Unread 23-01-2008, 16:13
garyk garyk is offline
Programming Mentor: 668, 972, 2643
FRC #0668 (Apes of Wrath)
Team Role: Mentor
 
Join Date: Dec 2006
Rookie Year: 2005
Location: Santa Clara (Silicon Valley) Calif.
Posts: 93
garyk is a jewel in the roughgaryk is a jewel in the roughgaryk is a jewel in the roughgaryk is a jewel in the rough
Re: steering wheel help FIRST Team 2044

668 has used a couple of steering wheels, and neither returned the full 0-255 range, we had to scale the output accordingly. To see what your steering wheel returns, add this to your code:


Code:
static int debug0_count=0;


// print every ~25 loops to avoid drowning in output. Adjust the constant
// for whatever rate you want:

if (debug0_count++ >= 25)
{ printf("JS1 parms: %3d %3d %3d %3d %d %d %d %d\n",
       (int)p1_x,
       (int)p1_y,
       (int)p1_wheel,
       (int)p1_aux,
       (int)p1_sw_trig,
       (int)p1_sw_top,
       (int)p1_sw_aux1,
       (int)p1_sw_aux2);

  debug0_count=0;
}
This code fragment prints every parm you can get from a joystick port. Of course, if you don't have the wheel plugged into Port 1, change "p1_" accordingly.

You can find all the joystick parms listed in the file ifi_aliases.h.