Connecting a usb game controller to a teensy 3.2

Status
Not open for further replies.

Electric Potato

Well-known member
Hey guys,

I want to connect a usb video-game controller to a teensy 3.2 in order to launch audio samples and control lights. My plan is to simply wire a female usb jack onto the 4 underside pads and plug the controller right in. However, I don't know what kind of serial data the controller sends, and will need to start the project by connecting the controller to teensy while teensy is connected to my computer, so as to check out the controller's packets in the console.
My question is, would I be able to connect the controller AND the computer to teensy's usb at the same time? Basically there will be two devices running on the same usb serial port, one sending usb data into the teensy (game controller) and one receiving usb data from the teensy (computer). It seems like that would be sketchy. Or if not, is there some kind of serial-console-software out there which would allow me to plug the controller into my computer and see what its packets look like?

thanks for any advice,

-epot
 
You can't just button the two USB devices together that way, and the Teensy 3.2 has pretty minimal USB host mode support in software. Your options are to use a USB host shield for Arduino, or join the people looking at host mode on the Teensy 3.5/6 which has hardware for a second USB port and more useful supporting elements internally but the work is certainly not a pick up and go thing.

Acting as a USB host and enumerating devices is complex task, much more so than just presenting 'I'm a USB x Device' message as the Teensy 3.2 currently does.
 
The chip on the teensy has hardware usb OTG support, but the software to support it is not trivial, If you just need game pad buttons I recommend using a different route. For example nes and snes controllers are just shift registers, you use any 3 pins on the teensy and latch, then clock in the buttons. If your heart is set on using a usb controller, follow grimlinwrangler's suggesting and get a USB Host adapter for arduino and use that.
 
Status
Not open for further replies.
Back
Top