Connecting Tech Pros Worldwide Forums | Help | Site Map

USB HID documentation?

ETP
Guest
 
Posts: n/a
#1: Jun 27 '08
I have a little robot project I'm programming in python using the
Lynxmotion SSC-32 servo controller via serial. I'd like to use a USB
game controller (PS2 style) to control the robot.

I've read a number of threads about the difficulty of using USB
without extensive understanding of the way it works, but a few have
stated that HID is different somehow. I definitely do not have any
USB knowledge, and I don't care to get into that. However, if USB-HID
is much simpler I would love to learn.

I have the python extensions for windows:
http://sourceforge.net/project/showf...group_id=78018
but I haven't found any documentation on how to implement HID in
python. Can anyone give me some examples or links?

Thanks much.
Diez B. Roggisch
Guest
 
Posts: n/a
#2: Jun 27 '08

re: USB HID documentation?


ETP wrote:
Quote:
I have a little robot project I'm programming in python using the
Lynxmotion SSC-32 servo controller via serial. I'd like to use a USB
game controller (PS2 style) to control the robot.
>
I've read a number of threads about the difficulty of using USB
without extensive understanding of the way it works, but a few have
stated that HID is different somehow. I definitely do not have any
USB knowledge, and I don't care to get into that. However, if USB-HID
is much simpler I would love to learn.
>
I have the python extensions for windows:
http://sourceforge.net/project/showf...group_id=78018
but I haven't found any documentation on how to implement HID in
python. Can anyone give me some examples or links?
You seem to misunderstand HID. HID is a protocol over USB (and Bluetooth I
believe) that will create user input device events which are mapped to your
OS input layer. That means that whenever you e.g. attach a keyboard device,
it's keyboard events will generate key-strokes on screen.

There are various kinds of HID-devices, and gamepads/joysticks generate
certain events.

So you need to look up you OS game device API and use that. Then attaching
any compliant HID-device should work.

Diez
ETP
Guest
 
Posts: n/a
#3: Jun 27 '08

re: USB HID documentation?


I don't doubt I misunderstand since most programming jargon goes over
my head.

That said, I'm sure you can guess my OS is Windows and I don't know
what an API is. After a quick search it looks like windows uses
something called DirectInput for gaming devices. Is anyone familiar
with DirectInput? Is it implementable in Python?

Here's my source: http://msdn.microsoft.com/en-us/libr...02(VS.85).aspx

Actually, I found this, too: http://directpython.sourceforge.net/

Sounds like it is very straight forward. i would definitely still
appreciate any comments or suggestions on the best way to implement a
game controller.

Thanks again.
Tim Roberts
Guest
 
Posts: n/a
#4: Jun 27 '08

re: USB HID documentation?


"Diez B. Roggisch" <deets@nospam.web.dewrote:
Quote:
>
>You seem to misunderstand HID. HID is a protocol over USB (and Bluetooth I
>believe) that will create user input device events which are mapped to your
>OS input layer. That means that whenever you e.g. attach a keyboard device,
>it's keyboard events will generate key-strokes on screen.
No, it's more than that. HID devices that are not of a type directly
claimed by the operating system (keyboards, mice) can be accessed by
user-mode programs very easily on both Linux and Windows, without writing a
custom driver. For low-bandwidth data sources, USB HID is an excellent way
to provide general-purpose access to a USB device.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Closed Thread