USB HID - Turn Arduboy Into Generic Gamepad


(Holmes) #1

Hey, guys! I don’t have my Ardubo in, yet, and I’ve never done Arduino programming, but I’m an experienced programmer in many languages and several different platforms. Since I’ve never worked with HID or USB communication, how feasible would it be to make a program that turns the Arduboy into a generic USB gamepad? Because of the HID, I think something like this would be possible, right? Is someone already working on this?


(Ross) #2

You can totally send signals down the wire emulating any signal you would like.

I recomend checking out the node packages for a serial interface.

Here’s a working example using the Arduboy


(Scott) #3

The Arduboy is really just an Arduino Leonardo with a OLED display, buttons, a speaker and an RGB LED (plus a battery and charging circuitry). So:
Arduino Leonardo/Micro as Game Controller/Joystick


(Holmes) #4

That’s awesome! :smiley: Looks a bit more ‘raw’ than a standard input device, but awesome, never-the-less.

Okay, now that’s what I was looking for! This is would be a great place to start. If someone doesn’t get to this by the time I get my Arduboy, I’ll give this library a shot. Would be nice to plug my Arduboy into other devices to use as a controller. I could even include input info on the screen.


#5

While it’s not quite acting as a gamepad, I wrote this program to be able to emulate keyboard input.

http://community.arduboy.com/t/arduboy-gamepad-map-buttons-to-keys/936?u=fuopy


(Holmes) #6

Dude! Your program is top-quality. Great job, man. That would be handy for both PC and could even be used on mobile devices to play games. Having a gamepad app would be great, too, since you could use it either on a PC (for games that don’t allow re-mapping) or even game consoles that are compatible with generic input like the PS3.


#7

Thank you!

There’s plenty of space free in the program to add more features. I’ll look into adding joystick support later. It would be awesome if it could be made to work as other controllers!


(Holmes) #8

@fuopy - Since I won’t be getting mine in for a while, I won’t be able to help code, but I’ll definitely keep an eye out on your work.


(Ross) #9

This is not true! You really can start programming for the Arduboy as long as you have an interface that can align or match with the Arduboy API. I posted a quick example near the bottom of the guide on how to setup a standard project that will allow you to start overriding some of the Arduboy API so things can be tested with just gcc :smile:

http://community.arduboy.com/t/where-to-start-in-development-without-an-arduboy/1098


(Holmes) #10

I’m going to try this out, but I’ll need to set up the IDE, etc. Skimming through, I see Cygwin may be necessary. I used it a long time ago and it was a major pain to deal with, so it may be a big headache to get everything going. If it’s not, I’ll play around with the IDE later tonight.


(Ross) #11

I agree totally.

I have actually begun using Vagrant for my projects. It would be really nice to get a VM manager like vagrant going so no one would have to do any setup, just clone a vagrantfile from a github project, then go to a command line and type

$ vagrant up

This will start the VM and allow a user to start right away. Docker is another great option to create development environments.

I have one I use, but I never quite got the serial connection working the VirtualBox or even through KVM.

Basically you just need to get gcc and make going, so if you can find guides for that, you are good to go.

Here is a list of boxes already out there, you can pick an OS and go for it.
http://www.vagrantbox.es/

Box for C++
https://atlas.hashicorp.com/xepa4ep/boxes/llp_kbtu_15

Visual Studio

You could also use visual studio, and just add that header ifndef block at the top, and use the windows tools to compile.


(Erwin) #12

Nobody ever created a Gamepad for the Arduboy? (not using the Keyboard HID?)