Making A Custom Teensy3 HID Joystick

Status
Not open for further replies.

FuzzyWuzzie

New member
Hello,

A few weeks ago I needed to change the Teensy's default usb joystick behaviour (ie, not have 6 axes + a hat + 32 buttons - only 4 axes + 16 buttons). I didn't really find any guides on how to do this, so I hashed it out myself and wrote a semi-quick guide for anyone else looking to do the same thing to hopefully save them some of the time and frustrations I had. The guide is up on my blog at http://www.hamaluik.com/?p=321. Hopefully someone finds this useful, but if I've left anything out or anything is too confusing, please let me know and I'll try to help you out!

PS, thanks for the EXCELLENT hardware platform to work off of! I already have 6 teensy3's and am considering more for some upcoming projects..
 
Hi,

Big thanks for the guide, I have managed to use it to make a new USB Gamepad type and get it to compile (haven't tested the hardware side yet though). Just one quick question for starters...

My device shows the correct name in the Devices & Printers section of Windows 7, but under Game Controllers is shows up as '4 axis 16 button joystick'. Did I miss something somewhere to change this?

Regards,

Les
 
My device shows the correct name in the Devices & Printers section of Windows 7, but under Game Controllers is shows up as '4 axis 16 button joystick'. Did I miss something somewhere to change this?

Showed correctly on another PC, and now shows correctly on this one after deleting some reg keys!
 
I've never understood why Microsoft doesn't simply use the device's info, which they full read every time the device is plugged in and they have to go through the USB enumeration. They pretty much created "Plug and Play" in the 90s and made every use it.

I guess they love their Windows Registry a lot and would rather depend on stale info, even when they always have the read everything freshly from the device every time it's connected. Crazy.
 
Sorry to drag up and older post but while working on a similar guide for the older teensy boards, it occured to me that the older way of doing this may have been better.

When upgrading the Teensy software any changes made to the following files WProgram.h, usb_desc.h, usb_desc.c and usb_inst.cpp for Teesny 3 will be overwritten. Which will effectively wipe out your custom joystick/usb device, especially if you haven't backed it up somewhere else.

For the older boards it will reset core_id.h, usb.c, usb.api.cpp, usb_api.h and usb_private.h in the teensy folder, but assuming you have added a new folder for you custom joystick/device the core files will be left intact. It's just a matter of adding 2 lines back to the above files for the includes.

Maybe the Teensy 3 should be done with includes, so custom USB devices aren't overwritten when doing software updates?

Regards,

Les
 
Custom USB Joystick

Hello,

I setup a Teensy 2.0 as a joystick following this tutorial: < https://www.pjrc.com/teensy/td_joystick.html >. It works as intended. The Teensy is recognized as a joystick with 8 axis and 32 buttons. That is fine, but exceeds what I need.

I am now trying to modify the joystick to show up with no axis and just 15 buttons. I tried following this tutorial: < http://www.planetpointy.co.uk/custom-teensy-2-0-joystick/ >, but I get stuck at: "We are going to add a new USB type for our new joystick and we will call it Gamepad. First open up the ‘boards.txt‘ file found in a ‘arduino install folder\hardware\teensy‘." I am doing this with an ArchLinux OS. The arduino files are located here: '~/.arduino15' and here: '~/Arduino'.

I have also sought assistance from Freenode.net #arduino IRC channel. The people there suggested that I come here for help with this. Any advice or suggestions would be super awesome.

Thanks.

Edit:
Since posting last I have found the install path it is: '/usr/share/arduino/hardware/teensy/avr/cores/' , but I seem to have the same results as vitormhenrique. Here is another link that has HID information: < http://eleccelerator.com/tutorial-about-usb-hid-report-descriptors/ >.
 
Last edited:
Status
Not open for further replies.
Back
Top