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

Thread: Teensy LC Inputs

Hybrid View

  1. #1
    Junior Member
    Join Date
    Sep 2020

    Teensy LC Inputs

    I'm making a raspberry pi handheld gaming console. I'd like to use 5 face buttons, 2 triggers, 4 button D-pad, and an analog joystick. This would require 13 analog inputs. I'd also like to add 2 digital capacitive touch sensors as additional buttons.

    I want to make sure I'm correctly reading the layout of the Teensy LC before I purchase the unit. According to:

    and the "Various microprocessor layouts" spreadsheet:

    the Teensy LC has 13 analog inputs located at A0-A9 (Right Side), A10-A11 (Inside Right), and A12 (Back Pins). Since I'm only trying to use the capacitive touch sensors as on/off, rather than a range of voltages, I can wire them to any pin on the left side and program the Teensy as such.

    Does this plan make sense? Is it just as easy to configure A10-A12 for analog input as it is with A0-A9? I've read a lot about microcontrollers, but I am totally new to all of this. Thank you in advance for any advice you can provide.

  2. #2
    Senior Member
    Join Date
    Apr 2013
    Is there any reason for things like the triggers need to be analog inputs? Normally you would read them via digitalRead and only the analog stick would use analogread? This means most of your inputs can connect where-ever convenient for the build (keeping wires sensible laid out and separated).

    The cap touch sensors will probably be the hardest part of this to get working reliably enough for a game controller, since you need low latency and high reliability (which means you want to use the pins with cap sense hardware available), it can be done but would suggest that is where to focus the early work. Remember things up to and including the weather and dirt on the surface can change the cap sense read value so there needs to be a degree of learning/self calibration (or just accepting you need to manually change the code sometimes)

    Next most complex is the analog axis, since while reading a value is easy enough you normally find there is a bit of math to getting the signal cleaned up, dead zone sorted etc

    The basic on off buttons are the easiest and would be suggesting keeping those out of the way until the analog parts are working to your satisfaction.

    When it comes to buying the hardware, it may be wise to buy a pair of LCs, this means you can have one to prototype and one clean one in your final controller. Improves the odds of success because you can compare and test and if worst case you have a spare if something does get shorted.

  3. #3
    Junior Member
    Join Date
    Sep 2020
    All this is excellent advice, thank you. I totally mixed up analog vs digital controls I suspected touch sensors might be the toughest part so I will definitely work on those first and make sure the teensy is easily accessible on the finished product. Luckily, I have 3d printed plates for all the on/off buttons, which means I can set them up and then solder them to the board after I finish touch sensors and the joystick. Two Teensy's makes sense when you put it like that. I've already placed my order, but I think I'll just work on controls first, then if anything goes wrong I'll switch to working on sound or power while waiting on the new board. Thanks!

Posting Permissions

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