Difference between revisions of "Joystick"
(→Test the joystick) |
(→Austria microsystems AS5011 joystick) |
||
Line 100: | Line 100: | ||
=== Austria microsystems AS5011 joystick === | === Austria microsystems AS5011 joystick === | ||
+ | |||
+ | The as5011 is a small hall effect joystick produced by Austria microsystem. This joystick must be plugged on i²c bus. The driver is included in ARMadeus distribution, but to use it, platform file (apf27-dev.c) must be modified. | ||
+ | |||
+ | Select as5011 driver in «make linux26-menuconfig»: | ||
+ | |||
+ | <pre class="config"> | ||
+ | Device Drivers ---> | ||
+ | Input device support ---> | ||
+ | [*] Joysticks/Gamepads ---> | ||
+ | <M> Austria Microsystem AS5011 joystick | ||
+ | </pre> | ||
== Links == | == Links == |
Revision as of 11:15, 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
The as5011 is a small hall effect joystick produced by Austria microsystem. This joystick must be plugged on i²c bus. The driver is included in ARMadeus distribution, but to use it, platform file (apf27-dev.c) must be modified.
Select as5011 driver in «make linux26-menuconfig»:
Device Drivers ---> Input device support ---> [*] Joysticks/Gamepads ---> <M> Austria Microsystem AS5011 joystick
Links
- Linux kernel code documentation