Difference between revisions of "Joystick"
From ArmadeusWiki
(→Test the joystick) |
(→Test the joystick) |
||
Line 50: | Line 50: | ||
<pre class="apf"> | <pre class="apf"> | ||
$ jstest /dev/input/js0 | $ jstest /dev/input/js0 | ||
+ | Joystick (Austria Microsystem as5011 joystick) has 2 axes and 1 buttons. Driver version is 2.1.0. | ||
+ | Testing ... (interrupt to exit) | ||
+ | Axes: 0: 32767 1: 32767 Buttons: 0:off | ||
+ | </pre> | ||
+ | |||
+ | Joystick can be calibrated with jscal command : | ||
+ | |||
+ | <pre class="apf"> | ||
+ | # jscal -c /dev/input/js0 | ||
+ | Joystick has 2 axes and 1 buttons. | ||
+ | Correction for axis 0 is broken line, precision is 0. | ||
+ | Coeficients are: 42, 42, 2147483647, -5835375 | ||
+ | Correction for axis 1 is broken line, precision is 0. | ||
+ | Coeficients are: 59, 59, -24402479, -4473788 | ||
+ | |||
+ | Calibrating precision: wait and don't touch the joystick. | ||
+ | Done. Precision is: | ||
+ | Axis: 0: 0 | ||
+ | Axis: 1: 0 | ||
+ | |||
+ | Move axis 0 to minimum position and push any button. | ||
+ | Axis 0: 69 | ||
+ | Hold ... OK. | ||
+ | Move axis 0 to center position and push any button. | ||
+ | Axis 0: 61 | ||
+ | Hold ... OK. | ||
+ | Move axis 0 to maximum position and push any button. | ||
+ | Axis 0: -118 | ||
+ | Hold ... OK. | ||
+ | Move axis 1 to minimum position and push any button. | ||
+ | Axis 1: 101 | ||
+ | Hold ... OK. | ||
+ | Move axis 1 to center position and push any button. | ||
+ | Axis 1: 63 | ||
+ | Hold ... OK. | ||
+ | Move axis 1 to maximum position and push any button. | ||
+ | Axis 1: -60 | ||
+ | Hold ... OK. | ||
+ | |||
+ | Setting correction to: | ||
+ | Correction for axis 0: broken line, precision: 0. | ||
+ | Coeficients: 61, 61, -67106816, -2949750 | ||
+ | Correction for axis 1: broken line, precision: 0. | ||
+ | Coeficients: 63, 63, -14127751, -4364671 | ||
+ | |||
</pre> | </pre> | ||
Revision as of 11:10, 8 July 2010
Page under construction...
Informations on this page are not guaranteed !!
Contents
Introduction
Joystick can be a good device to play some games or to use graphical interface. Linux has an interface for it named joydev, to use it select joydev in linux configuration :
$ make linux26-menuconfig
then select in menu:
Device Drivers ---> Input device support ---> <*> Joystick interface
To use it on the target, node has to be made :
cd /dev rm js* mkdir input mknod input/js0 c 13 0 mknod input/js1 c 13 1 mknod input/js2 c 13 2 mknod input/js3 c 13 3 ln -s input/js0 js0 ln -s input/js1 js1 ln -s input/js2 js2 ln -s input/js3 js3
Test the joystick
Two programs named jstest and jscal wrote by Vojtech Pavlik can be use to test and calibrate the joystick. To use it select joysticktest package in buildroot :
$ make menuconfig
Package Selection for the target ---> [*] joysticktest
To test the joystick on platform, just launch jstest with /dev/jstx argument :
$ jstest /dev/input/js0 Joystick (Austria Microsystem as5011 joystick) has 2 axes and 1 buttons. Driver version is 2.1.0. Testing ... (interrupt to exit) Axes: 0: 32767 1: 32767 Buttons: 0:off
Joystick can be calibrated with jscal command :
# jscal -c /dev/input/js0 Joystick has 2 axes and 1 buttons. Correction for axis 0 is broken line, precision is 0. Coeficients are: 42, 42, 2147483647, -5835375 Correction for axis 1 is broken line, precision is 0. Coeficients are: 59, 59, -24402479, -4473788 Calibrating precision: wait and don't touch the joystick. Done. Precision is: Axis: 0: 0 Axis: 1: 0 Move axis 0 to minimum position and push any button. Axis 0: 69 Hold ... OK. Move axis 0 to center position and push any button. Axis 0: 61 Hold ... OK. Move axis 0 to maximum position and push any button. Axis 0: -118 Hold ... OK. Move axis 1 to minimum position and push any button. Axis 1: 101 Hold ... OK. Move axis 1 to center position and push any button. Axis 1: 63 Hold ... OK. Move axis 1 to maximum position and push any button. Axis 1: -60 Hold ... OK. Setting correction to: Correction for axis 0: broken line, precision: 0. Coeficients: 61, 61, -67106816, -2949750 Correction for axis 1: broken line, precision: 0. Coeficients: 63, 63, -14127751, -4364671
List of joysticks tested
Austria microsystems AS5011 joystick
Links
- Linux kernel code documentation