Hi,
I am working on my controller with Teensy 3.1, and I am using a matrix to add more inputs than the available digital IO available.
My first switch is connected to pin 2 and 7 on one pin of the switch and the second pin is connected to ground. The second switch is connected to pin 2 and 8 to one pin of the switch; while the other pin goes to ground.
The peculiar thing is that when I turn on either of the switches; they both go on. I did add a couple of LED; and in my code I did set the first LED to go on when the first switch is enabled, and the second LED to go on when the second switch is enabled. They both turn on at the same time.
Why do I get this behavior? I am trying to connect 40 buttons and switches to the Teensy and use it for flight sim. Any help would be really appreciated. Thanks!
I am working on my controller with Teensy 3.1, and I am using a matrix to add more inputs than the available digital IO available.
Code:
2 - 3 - 4 - 5 - 6
------------------------
7 X
------------------------
8 X
------------------------
9
------------------------
10
------------------------
11
------------------------
14
------------------------
15
------------------------
16
------------------------
My first switch is connected to pin 2 and 7 on one pin of the switch and the second pin is connected to ground. The second switch is connected to pin 2 and 8 to one pin of the switch; while the other pin goes to ground.
The peculiar thing is that when I turn on either of the switches; they both go on. I did add a couple of LED; and in my code I did set the first LED to go on when the first switch is enabled, and the second LED to go on when the second switch is enabled. They both turn on at the same time.
Why do I get this behavior? I am trying to connect 40 buttons and switches to the Teensy and use it for flight sim. Any help would be really appreciated. Thanks!