Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy as USB gamepad, wiring tacts and USB

  1. #1
    Junior Member FreedomCookie's Avatar
    Join Date
    Jun 2019
    Location
    My parents' basement
    Posts
    2

    Teensy as USB gamepad, wiring tacts and USB

    I'm new to Teensy and haven't yet bought one, and I have some questions that seem like they should be really basic but I just can't seem to find answers to that I can easily understand. For some background on my project, I'm planning a portable game unit running RetroPie on a Raspberry Pi B+, and I think I'm going to use a Teensy 2.0 without headpins as the internal game controller. I'm planning 14 to 16 tactile switches, 2 analog joysticks, and 2 analog potentiometers. I will not be using a breadboard.

    1. Can I solder the wires directly between the tacts and the Teensy? Which pins will I connect them to?
    2. I initially wanted to remove the USB port on the Teensy and one on my Raspberry Pi and solder them directly in order to slim down the guts inside the unit, but
      1. I don't know how to force the Raspberry Pi to recognize the Teensy as a joystick or gamepad, and
      2. Even if I did, I would want to leave my options open in case I need to reprogram the Teensy.

      I think I can hack together a solution for B, but it would be sloppy at best and I don't wanna reinvent the wheel if someone else has a better answer. I don't even know how to begin handling A.


    Apologies if I'm asking tedious or basic questions but I just can't seem to find a good explanation. Thanks for the help!

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,023
    Looking at the list it seems 16 digital pins and 4 analog pins would be needed.

    Suggest reviewing the available Teensy products - it seems a 32 bit Teensy LC or 3.2 would easily solve the problem and provide a much more powerful tool that is more modern and represented here. I have used 8 bit AVR processors - but never a Teensy 2. The 32 bit ARM cores have much more power and more active support.

    These 32 bit Teensy units have native hardware USB and can present as a joystick with a compile option. With a release build of the IDE installed after TeensyDuino is installed - when the Teensy board is selected the USB options on Tools menu will show selecting the Joystick, and then finding Example code for Teensy as installed or perhaps noted on PJRC.com should get to a starting point for the code.

    >If a Teensy is ordered without pins the open pin holes can have M or F headers or wires soldered in place.

    >Removing the USB connector would be risky. The Teensy LC and 3.2 expose USB Pads on the underside while leaving the connector in place if that was somehow needed - it might be usably done. The Teensy can be programmed from the Raspberry Pi with a USB connection.

  3. #3
    Junior Member FreedomCookie's Avatar
    Join Date
    Jun 2019
    Location
    My parents' basement
    Posts
    2
    Thanks for the quick response! I have a couple of followup questions.

    - How would I decide between a 3.2 and an LC? From looking at the tech specs, I'm not seeing any practical difference.
    - Why would it be risky to remove the USB port?

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,023
    Yes either of those 32 bit units is a practical improvement over the 8 bit AVR.

    While the LC and 3.2 are developed to be interchangeable in large part - RAM & Flash Memory and speed are a big difference between the 3.2 and the LC - the cost may be a factor that would suggest the LC over the 3.2. The 3.2 has 5V tolerant pins as well, not so on the LC if that could be an issue.

    Removing the USB connector will take some heat and effort between the larger ground tabs - then the few fine pitch data/power tabs - offering the potential to dislodge or ruin other nearby components in tight spacing or perhaps lift the tiny pad traces needed to get USB on the topside - and the narrow spacing may not end up with a usable place to connect anything like USB cable wires. It will forever remove the connector and require the cabling to function to reprogram the Teensy. The bottom side pads are much larger with better spacing and free space with no mounted components there - and if you ruin those by lifting the pads with heat or tension the connector will ideally still work on the top.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •