OK I have done a bit more testing and here are all the specifics now and what is happening that i am trying to figure out:
Here is the code of the best working 1x7 matrix:
/* Base File
// Included Libraries
#include <Keypad.h>
// Variable Declaration
String msg;
#define PSWROWS 7
#define PSWCOLS 1
//Define Button Numbers and Pin Map
byte PSWbuttons[PSWROWS][PSWCOLS] = {
{ 1},
{ 2},
{ 3},
{ 4},
{ 5},
{ 6},
{ 7},
};
byte PSWrowPins[PSWROWS] = { 10, 9, 8, 7, 6, 5, 4}; //row pinouts
byte PSWcolPins[PSWCOLS] = { 3}; //column pinouts
//initialize Keypad Physical Matrix
Keypad PSWstandard = Keypad( makeKeymap(PSWbuttons), PSWrowPins, PSWcolPins, PSWROWS, PSWCOLS);
// Program
void setup() {
Serial.begin(38400);
PSWstandard.setDebounceTime(20); // Default is 50mS
}
void loop() {
CheckAllButtons();
}
void CheckAllButtons(void) {
if (PSWstandard.getKeys()) {
for (int i=0; i<LIST_MAX; i++) { // Scan the whole key list.
if ( PSWstandard.key[i].stateChanged ) { // Only find keys that have changed state.
switch (PSWstandard.key[i].kstate) { // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
case PRESSED:
msg = " PRESSED.";
break;
case HOLD:
Joystick.button(PSWstandard.key[i].kchar, 1);
msg = " HOLD.";
break;
case RELEASED:
msg = " RELEASED.";
break;
case IDLE:
Joystick.button(PSWstandard.key[i].kchar, 0);
msg = " IDLE.";
break;
}
int iB = PSWstandard.key[i].kchar;
Serial.print("Button ");
Serial.print (iB);
Serial.print(PSWstandard.key[i].kchar);
Serial.println(msg);
}
}
}
}
This code works perfectly off the pins on the Tensy LC I am using:
I have a Ethernet Socket on a Breakout board soldered to the Teensy LC with the 8 outputs from the socket going to pins 3 - 10 attached through a header for the shortest most direct connection.
I have tried multiple hardware and everything does the same thing so it is not a hardware or connection issue directly..
Anyway Results (with the code above)...
#1. Buttons directly connected to the Teensy - Everything works Correctly
#2. Buttons connected through a .5M Ethernet cable with an ethernet socket on the other end for button connection - Everything Works Correctly
#3. Buttons connected through a 1.8M Ethernet cable all buttons work as intended EXCEPT button "2" at Column 1, Row 2 witch also triggers "1" at Column 1 Row 1
#4. Buttons connected through a 3M Ethernet cable all buttons "2, 3, 4, 5, 6, and 7" trigger the correct button + "1" at Column 1 Row 1
Now, if I alter the program to have 7 columns and 1 row (instead of the above 7 row 1 column) I get more random triggering than the above and actually get constant triggering on buttons "4, 5, and 7" when just connecting the 3M ethernet cable without even pressing a button.. same sort of results otherwise in that the .5M works, 1.8M sort of works.
When I run the full matrix program with 16, buttons with rows on pins 3, 4, 5, and 6 with columns on 7, 8, 9, and 10. I again get perfect with .5M or shorter, oddity with 1.8, and dual triggers with 3M.. rows 1 and two pins 3 and 4 will trigger with each other in this case..
Anyway I am not sure any of this has to do with the program itself but if there is any thought on a workaround programming wise to still allow for multiple button presses along with error rejecting or any added information about the possibility of using external pull-up resistors on the KeyPad array and what can and cannot be done there as in all honesty I do think it is a low voltage ghost in that the pins are on the verge of going low and with the wire connected in the extended length, 3M especially because that is where I need to get to, it is pulling the voltage just barely to the low state making the buttons flicker on their own or turn on without being pressed.
Anyway I am at a loss and I really don't want to screw things up by putting a resistor where I shouldn't and frying something.