Control Teensy 3.0 via game pad?

Status
Not open for further replies.

raac

New member
Hi,

I have a project for which I would like to control three seperate stepper motors independently using the analog sticks on a game-pad. One analog stick will control one pair of steppers (x and y) and the second stick will control the final motor. I was initially planning on doing this with a Raspberry Pi and a PS3 game pad. This way I could use the shoulder buttons to switch between coarse and fine motions (i.e. full steps and micro-steps). Now I'm wondering if it will be possible to do it with a Teensy 3.0 instead of a Rasperry Pi. I prefer the simplicity of the Teensy for this task. I know that analog control sticks are available on SparkFun (https://www.sparkfun.com/products/9032) but I like the form factor of the joypad with the buttons, etc. So are there any libraries out there which will allow me to plug a USB joypad into the Teensy and convert position of the analog sticks into whatever output signal I choose (e.g. a "tone" or an analog output) to contol the stepper drivers? I guess an alternative might be open up the joypad, by-pass the USB, and hook up the buttons and analog sticks I need directly to the Teensy input pins. That would be a pain, though. Anyone have suggestions?

EDIT: it seems that this might be one option: http://airspayce.com/mikem/arduino/USBJoystick/ and another: USB host shield and PS3: http://www.circuitsathome.com/mcu/s...usb-host-library/comment-page-1#comment-22205

Any other suggestions would, of course, be welcome!
 
Last edited:
You would need something like the host shield, but its library is not ported to Teensy3 yet.

I actually started work on this recently, but it got set aside because so many other things were more urgent. Here's the work-in-progress code. It at least compiles, but it's untested so far. If you're feeling like a challenge, this might be interesting. But if you're looking for an easy path to getting the PS3 controller working, this probably isn't ready just yet.

https://github.com/PaulStoffregen/USB_Host_Shield_2.0
 
The host shield does work on Teensy 2.0... so if you don't need 3.0's features, using a 2.0 board might be a fairly easy path.

I also have a host shield board that was made for Teensy 2.0, but never fully released. I have several boards here. They're untested (one of the things I never got around to doing was building a test fixture) and very little documentation is available, but at least a few people have used this unreleased product successfully, so they do work nicely.
 
The host shield does work on Teensy 2.0... so if you don't need 3.0's features, using a 2.0 board might be a fairly easy path.

I also have a host shield board that was made for Teensy 2.0, but never fully released. I have several boards here. They're untested (one of the things I never got around to doing was building a test fixture) and very little documentation is available, but at least a few people have used this unreleased product successfully, so they do work nicely.


Cheers, that's useful. I'm not particularly attached to the Teensy for this purpose (it just happens to be the only mic I have on hand right now). I'll probably give the Arduino a shot. TBH, the Teensy 3 is overkill for this job anyway. The only extra thing I'll need is a shift register, or I'll run out of pins.
 
Status
Not open for further replies.
Back
Top