T2.0 newbie help for flight controller button box

Status
Not open for further replies.

Sprool

Active member
I am starting to put together a button box as a controller for DCS World flight sim, I have a Teensy 2.0, about 25 switches (needing a button matrix approach) some pots and rotary encoders. Its not clear to me exactly what pins I can use on the T2 and for what purposes. If I go for 25 switches and a 5 x 5 matrix then I need 10 pins but I then need to leave some available for the rotary encoders (assume thats pins 5 - 8?) and analog reads for the pots?
When I connect rotary encoders they run fine in one of the example programs but as soon as I try to get Windows joystick controller to recognise the outputs the rotaries are very jittery and often fire off other buttons while being turned. How can I clean up the signals so I can map controls to them in DCS? (thinking of non-critical mapping like radio volumes, lighting levels, etc)?
Thx!
 
On the Teensy 2.0 I have pins 0 to 23, then theres 2 pins for GND and 2 pins for +5v, and a reset. Can I use all pins 0 - 23 for digital switches? But then only pins 5 to 8 for interrupt polling (rotary enc.) and any pins A0 to A11 (pins 11 to 22) for analog input - is that correct?
 
On the Teensy 2.0 I have pins 0 to 23, then theres 2 pins for GND and 2 pins for +5v, and a reset. Can I use all pins 0 - 23 for digital switches? But then only pins 5 to 8 for interrupt polling (rotary enc.) and any pins A0 to A11 (pins 11 to 22) for analog input - is that correct?

I think you are right.
But you have one more digital pin 24, also useable for interrupts.
 
is that the one labelled E6, just in from B3? Its all quite confusing, the pin 21 is labelled as F0, 20 = F1 then 19 = F4, what happened to F2 and F3?
 
Will I be ok using the HelloKeypad example but inserting a bigger matrix for my button presses to be picked up by windows joystick controller? I'm looking at 5 x 6 button matrix, I dont need to assign characters or serial print them, having the little LED flashing as confirmation of a button press would be useful?
 
is that the one labelled E6, just in from B3? Its all quite confusing, the pin 21 is labelled as F0, 20 = F1 then 19 = F4, what happened to F2 and F3?

YES, Pin 24 is labled E6 on PCB.
It seems confusing because Teensy2.0 is an old 8bit-AVR product. Introduced before IDE Teensyduino come. The F2 and so on are the values for die C compiler without IDE. Simply look here https://www.pjrc.com/teensy/pinout.html for Pin Assignments, Using Arduino Software.
 
Thx Larry but I have that diagram already and its certainly not very clear to me - the later models with colour coding of the various pin areas seem a bit more intuitive but the 2.0 documentation is sparse and lacks much clarity for a newbie like me. Theres also some refs to not using pin 11 as its needed for the LED - what if I dont need the LED? So many questions!
 
Some progress made - I increased the keypad button matrix to 4 x 6, avoided pin 11, added a little routine for the internal LED to flash whenever a button is pressed, wired up the button matrix, and all prints fine to serial, but joystick controller not picking anything up.
I new need to assign each button keypress to a joystick button.
Any help in how to do that?
Puurleease!
 
Status
Not open for further replies.
Back
Top