noob question about teensy 3.2 usage

Status
Not open for further replies.

AlainD

Well-known member
Hi

I've a question about the digital I/O pins on Teensy 3.2 with pins.

Am I correct that the I/O's 0-23 are available on the pins for I/O, with the special case for pin 13.

I would use
- 15 pin's for 5 rotary encoders with switch (all digital input)
- 7 pin's for a 3*4 keypad (all digital input)
- 2 pin's to get output to two led's (one would be pin 13)

Or do I make a (stupid) mistake?


Alain
 
Sounds right to me. Even more are on the back, but those are not breadboard friendly. That is a lot of inputs to only control 2 led's. Are you sure you are not leaving out some outputs to control something or user feedback like a display maybe? Do you plan on polling the encoders with software/ interrupts?
 
Last edited:
Thanks.

I know that there are more on the back, but my soldering skills are very low.
I will try to make an input device that either mimics a usb keyboard or a midi input device.
It will have a 3*4 keypad for input and most important 5 knobs as rotary encoders that will give "specific key presses" depending on the direction of the turn.
I would make 4 separate banks in software, to give more input possibilities (about 40 key's and 20 knobs settings).
The 2 led's will be used to give an indication of which bank is activated in SW.

I would start with polling on about a 1 ms frequency and do SW debouncing.
 
1ms polling seems a bit overkill for the keypad. I'd recommend doing a sweep every 10ms, and the debouncing is that you want four consecutive matching readings to determine whether a key is pressed, or released.

For the rotary encoders, these are better done using interrupts. Polling is never a good method for those.

Also, its a very good idea to have a simple RC filter on all inputs.
 
There is a debounce keyboard library for Teensy. And a rotary encoder library that has optimized proven code to deal with all the issues.
 
I highly recommend using the already-written libraries: Keypad, Bounce2 and Encoder. Each requires a bit of learning, but it's time well spent. These can save you a ton of software work.

For each type of input device, do yourself a favor and connect just 1 for testing & learning. We've had many ambitious DJs and musicians try to build huge MIDI controllers, where some small misunderstanding required tons of work rewiring parts. Don't make the mistake of connecting everything before you begin learning how things really work. If you already understood everything perfectly, this extra step only adds a little more work. If you do have "learning experiences" along the way, it can really minimize the pain and make all the difference towards ultimately making everything work.
 
First big thanks to all that replied.

I will surely go very slowly with the HW side and test things one at a time.

I have quite some years SW dev experience and will surely use the libraries that are useful.
I will use the result to add knobs (and some button's) to a photographic application, turning a knob is much faster than using either the keyboard or the mouse.

BTW. AM I correct in reading the schematic that there's a 470 ohm resistor between the pin13 led and ground?
 
Status
Not open for further replies.
Back
Top