Possible to use arduino as a HID controller?

Very new to this whole world, but I’m curious–

Is it possible to program the USB Arduino so that it represents itself a HID-based input device? I’m trying to find a way to make a generally (very) customizable game controller (reading all kinds of inputs, from buttons to rotation-based controllers, whatnot), and it looks like Arduino may do it… maybe.

If it can’t represent itself as a HID controller, I could probably (?) find a way to write a user-space program that reads its values and then inserts keypresses, etc into the input stream, but I’d like to make it as transparent as possible… or is there a better way to approach this?

Thanks,
Vic

Oh. Like a regular USB input device? Sort of a “make your own joystick” general purpose driver, yes? There’s all kinds of code to get arduino to talk to flash, processing, max, but… yeah, what about getting it to work as a general purpose USB device… if I understand your question correctly.

Oh. Like a regular USB input device? Sort of a “make your own joystick” general purpose driver, yes? There’s all kinds of code to get arduino to talk to flash, processing, max, but… yeah, what about getting it to work as a general purpose USB device… if I understand your question correctly.

That’s what I’m asking, all right. Basically, I’m wanting to take the signal from a rotational encoder connected to pedals and transform the speed into either a game axis control or a pushbutton depending on the speed (so one key for walking and one for running, or one for walking and that plus another for running, whatnot). Sort of a “pedal to play” game controller so I can feel healthily justified in playing computer games (lol).

There are plenty of circuits out there which can simulate input devices, but axes are almost always based on potentiometers, not speed (and of course you’d want to calibrate it)–and button are almost always “game device buttons” where I’d need to also be able to generate keypresses. One idea (heavyweight) would be to have the arduino serve as a programmable logic box and then connect its output with a HID device circuit…

Dunno, just throwing around ideas.

hello

The arduino board communicates with the usb bus through a chip made by FTDI that has been specifically designed
to implement a virtual serial port. This means that it can’t be used to emulate any HID device.

ftdi allows you a lower level access to the chip through a different driver. this could be used to develop your own driver and possibly show up as a gamepad in your computer.

this will require quite a lot of software work on the operating system side.

there is another option…

this is a bit hardcore and requires quite a bit of experience. if you build an arduino serial board and replace the 16MHz quartz with a 12MHz quartz you can program it with this software:
http://www.obdev.at/products/avrusb/index.html

this is a full USB stack implemented in software… they also have an HID example.

it’s going to be difficult for a beginner but not too difficult

have fun

massimo

Thanks, Massimo… that does answer my question, though I had been more hopeful (grin)–I don’t care to write my own Windows driver again (in fact, one AVR project I’m considering once I understand more is a plan to implement my “represent a serial SpaceOrb as a HID device” driver in hardware so I don’t have to muck about with OS drivers again…).

I had seen the AVRUSB project–although I think for my purposes (and so that anyone else who stumbles across this thread with similar intent will know) there’s a project in the flight sim world which uses Igor Cesko’s similar USB-on-AVR stack to implement a basic HID controller here; he has full software available for the Mega8 version, and I assume something similar would work with the Mega16 version he has pictured; it would let me just buy a board and ISP cable and get hacking (I don’t mind soldering, but while I’m learning I’d rather start with an assembled/tested circuit so I’m more certain that problems are software-related rather than hardware-related).

I was just hoping to avoid “bit banging the USB interface” and doing it a bit more elegantly, but I’m skeered of just jumping in with a whole new part and building from the ground up with SMD soldering like I’d need to do with Atmel’s new USB parts. So it was just a thought.

Thanks for the responses!

Vic