[SDL] calibration of inputdevices

Samuel taxtropel_news at yahoo.com
Fri Nov 21 07:39:00 PST 2003

great, I'm just trying to make the most robust code I can, the more feedback 
the better. 

After this I plan on adding calibration to the program, (jscal style)

here's what the Linux kernel documentation has to say about it.

(only an excerpt about calibration from 
/usr/src/linux/Documentation/input/joystick.txt )

*** Begin Paste ***

2.6. Calibration
  For most joysticks you won't need any manual calibration, since the
joystick should be autocalibrated by the driver automagically. However, with
some analog joysticks, that either do not use linear resistors, or if you
want better precision, you can use the jscal program

        jscal -c /dev/js0

 included in the joystick package to set better correction coefficients than
what the driver would choose itself.

  After calibrating the joystick you can verify if you like the new
calibration using the jstest command, and if you do, you then can save the
correction coefficients into a file

        jscal -p /dev/js0 > /etc/joystick.cal

  And add a line to your rc script executing that file

        source /etc/joystick.cal

  This way, after the next reboot your joystick will remain calibrated. You
can also add the jscal -p line to your shutdown script.

*** End Paste ***

On Friday 21 November 2003 12:58 am, you wrote:
> Hi!
> Thanks for your reply.
> There is nothing wrong with your program actually, at least not in my case.
> The joypad is just not calibrated good enaough.
> I like the program though :)
> --Anders Folkesson
> --- Samuel <taxtropel_news at yahoo.com> wrote:
> can you send me some screen shots and some more details on your joystick,
> and I'll see what I can do for calibration towards that,
> Also give SDLJoytest-GL a try as it has many bug fixes.
> right now the range for the axes in SDLJoytest are hardcoded at 65534, w/ a
> zero for middle (-32767 -> 0 -> 32767) and there may be a problem w/ this.
> (it was something I was worried about, but I've only got 3 joysticks/pads
> to test w/ so...)
> The next release will include user config file and a global config file.
> but hey! I'm glad to see people giving my stuff a try! thanks a bunch!
> Samuel E. Bray
> On Thursday 20 November 2003 1:54 pm, Anders Folkesson wrote:
> > Hello!
> > I just got myself an usb joypad. It works fine except it is a bit
> > miscalibrated under linux. If i calibrate it under windows it is okay in
> > win. But when testing it with .i.e SDLJoytest one clearly sees that it is
> > a bit upp/left. My quetion is now, how does one calibrate an input device
> > in linux...or rather, is this something that each program should take
> > care of or is it something for the usb device drivers?
> >
> > Sorry if this is a bit off topic but i have to start somewhere ;)
> >
> > --Anders Folkesson
> >
> > _____________________________________________________________
> > Get your free web-based e-mail account from http://www.Math.net
> > Your online tourguide of Mathematics, with books, links, news,
> > message boards, and much more!
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at libsdl.org
> > http://www.libsdl.org/mailman/listinfo/sdl

"They that can give up essential liberty to obtain a little temporary safety 
deserve neither liberty nor safety. "
--Benjamin Franklin

More information about the SDL mailing list