From 8282c3d8c3456bfa31835c9c064e619b000a2667 Mon Sep 17 00:00:00 2001 From: 7hunderbug Date: Mon, 16 Feb 2015 19:21:03 +0000 Subject: [PATCH] Created Controllers set-up (markdown) --- Controllers-set-up.md | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Controllers-set-up.md diff --git a/Controllers-set-up.md b/Controllers-set-up.md new file mode 100644 index 0000000..57c0f1b --- /dev/null +++ b/Controllers-set-up.md @@ -0,0 +1,54 @@ +## Xbox 360 Wireless controller for PC in Raspbian +* Remove xpad kernel module: `sudo modprobe -r xpad` + +* Blacklist xpad kernel module: `sudo nano /etc/modprobe.d/gamepad.conf`. Add the line `blacklist xpad`, save and exit. + +* Install xboxdrv: `sudo apt-get install xboxdrv` + +* Test xboxdrv using following command: `sudo xboxdrv`. Check that all controls show relevent output to console. Ctrl+C to abort. Output should be similar to the following: + +``` +Controller: Microsoft Xbox 360 Wireless Controller (PC) +Vendor/Product: 045e:0719 +USB Path: 001:004 +Wireless Port: 0 +Controller Type: Xbox360 (wireless) + +Your Xbox/Xbox360 controller should now be available as: + + /dev/input/js0 + + /dev/input/event3 + +Press Ctrl-c to quit, use '--silent' to suppress the event output + +X1: -359 Y1: -1247 X2: -4580 Y2: -393 du:0 dd:0 dl:0 dr:0 back:0 guide:0 start:0 TL:0 TR:0 A:0 B:0 X:0 Y:0 LB:0 RB:0 LT: 0 RT: 0 +X1: 109 Y1: -1247 X2: -4580 Y2: -393 du:0 dd:0 dl:0 dr:0 back:0 guide:0 start:0 TL:0 TR:0 A:0 B:0 X:0 Y:0 LB:0 RB:0 LT: 0 RT: 0 +X1: 577 Y1: -1247 X2: -4580 Y2: -393 du:0 dd:0 dl:0 dr:0 back:0 guide:0 start:0 TL:0 TR:0 A:0 B:0 X:0 Y:0 LB:0 RB:0 LT: 0 RT: 0 +X1: 577 Y1: -848 X2: -4580 Y2: -393 du:0 dd:0 dl:0 dr:0 back:0 guide:0 start:0 TL:0 TR:0 A:0 B:0 X:0 Y:0 LB:0 RB:0 LT: 0 RT: 0 +X1: 577 Y1: -316 X2: -4580 Y2: -393 du:0 dd:0 dl:0 dr:0 back:0 guide:0 start:0 TL:0 TR:0 A:0 B:0 X:0 Y:0 LB:0 RB:0 LT: 0 RT: 0 +``` + +* Test xboxdrv with limelight: `sudo xboxdrv & java -jar limelight.jar stream Host.IP.Add.ress`. Ctrl+C to abort limelight. `fg` to foreground the xboxdrv process and Ctrl+C again to abort. + +* Set xboxdrv to run automatically on boot-up, waiting for Xbox 360 controller to connect: Edit `/etc/rc.local` and add your xboxdrv command line before `exit 0` lines. For example; `xboxdrv --trigger-as-button --wid 0 --led 2 --deadzone 4000 --dpad-rotation 90 --axismap -DPAD_X=DPAD_X --silent &`. + +If you have problems with buttons or directions being incorrect, you'll need to look at options for xboxdrv. + +For certain controllers, the analogue triggers have a habit of registering input when they are not pressed. For most games that don't require analogue triggers (driving and flying games may need them), this can be fixed by adding `--trigger-as-button` option. + +Also, sometimes the dpad gives incorrect results. This can be fixed by rotating and remapping the dpad axis (by default, the dpad on xbox 360 controller is read as an input with axis rather than input by buttons) using the `--dpad-rotation` and `--axismap` options. +For example: + +`xboxdrv --trigger-as-button --deadzone 4000 --dpad-rotation 90 --axismap -DPAD_X=DPAD_X` + +Or by setting the dpad as a button input: + +`xboxdrv --trigger-as-button --deadzone 4000 --dpad-as-button` + +###Issues +Sometimes buttons or directions are read incorrectly. + +LED ring keeps flashing as though searching for a connection, even when setting `--led 2` option. + +Analogue triggers set-up needed to accommodate driving and flying games (e.g. throttle on right trigger). \ No newline at end of file