Skip to content

PiHut controller button mapping problem #43

Description

@ralphhughes

Good morning,

I've bought the PiHut 2.4Ghz wireless controller from here . I'm connecting this to a Raspberry Pi Zero W mounted on my robot.

$ dmesg detects it as a "ShanWan PC/PS3/Android" controller:

[ 4496.194008] usb 1-1: New USB device found, idVendor=2563, idProduct=0575, bcdDevice= 2.00
[ 4496.194036] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4496.194049] usb 1-1: Product: PC/PS3/Android
[ 4496.194060] usb 1-1: Manufacturer: ShanWan
[ 4496.217141] input: ShanWan PC/PS3/Android as /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0/0003:2563:0575.0001/input/input0
[ 4496.218858] hid-generic 0003:2563:0575.0001: input,hidraw0: USB HID v1.10 Gamepad [ShanWan PC/PS3/Android] on usb-20980000.usb-1/input0

I've installed your excellent python library, and then attempted to write a python script to control the BrickPi3 hat on my robot using the wireless controller. I eventually concluded that the button mappings are all wrong, none of the circle, square, cross, triangle buttons map correctly. The left trigger maps to select, select maps to l2, l1 maps to triangle etc. In addition both analogue sticks seem to have large dead\hot zones covering over 50% of the analogue sticks range, although I don't know if this is a hardware quality issue.

To exclude my code, I've cloned your repo and run python3 scripts/show_controls.py and it shows the same incorrect mappings for my controller. I'm willing to try and debug\write code\submit a pull request, however I'm primarily a Java programmer and my python code is at beginner level! Could you point me in the right direction as to how to start debugging this?

Many thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions