Gamepad Teensy Code

I finished the Teensy gamepad code I’ll be using for the gamepads back in January.  The base code allows me to very easily configure the number of buttons, the name it shows up as in Windows, and a serial number.

I have made this code available as Open Source for anyone interested at http://robertbyam.com/code

In other news, I’ve successfully written a small library that allows me to find out what USB device is attached to a specific USB port on the computer.  I have a small 4 port USB hub that will be inside the computer and plugged directly into the motherboard, and the 4 ports will be on the front of the NES case where the original NES controllers would plug in.  I search all USB devices on the system for this specific hub, which I find by the manufacturer and product IDs.  I can then tell what is plugged into each of the 4 ports on the hub.

Using this information, I will be able to show at the bottom of the main CES screen what controllers are plugged in, and also show which will be player 1, 2, etc. whenever a specific game is selected, as well as which controllers are disabled because they don’t have enough buttons.  This way, it will work similar to the original Nintendo, where the player number was determined by what spot the controller was plugged into.

I built one NES controller with the Teensy inside, and it just barely fits and works well.  I also got some SNES controllers off of ebay, and they are thicker, so there will be too much room.  I’ll have to glue the Teensy down so it doesn’t rattle around inside.


Next Post:

Leave a Reply


WordPress theme by LeadCamp, Inc