One Switch on Keyboard Matrix Doesn't Work

Hello Everyone,
I'm trying to make a mechanical keyboard with a Teensy 2.0. It uses a matrix. However, one of the switches doesn't work! I've checked all the connections with a multimeter and there are no breaks in the connection. It's all insulated and if something were to break it would likely take out the entire row, but this is only one key. I replaced the diode and switch but still nothing. I even bridged the switch closed and it still wouldn't read as pushed. I'm starting to think it's a software issue but the code is no different than the others. I doubt the pins are incorrect as all the other switches work.
Any ideas on what I could do to figure out what's going on? Any help is much appreciated!
Thanks!

(The broken key is named KP13)
(I am using Serial.println to test)

//A section of the Matrix scanning code
  digitalWrite(OUT1, LOW);
  if (digitalRead(INP1) == LOW) {
    KP1 = 0;
  }
  else {
    KP1 = 1;
  }
  if (digitalRead(INP2) == LOW) {
    KP2 = 0;
  }
  else {
    KP2 = 1;
  }
  if (digitalRead(INP3) == LOW) {
    KP3 = 0;
  }
  else {
    KP3 = 1;
  }
  if (digitalRead(INP4) == LOW) {
    KP4 = 0;
  }
  else {
    KP4 = 1;
  }
  if (digitalRead(INP5) == LOW) {
    KP5 = 0;
  }
  else {
    KP5 = 1;
  }
  if (digitalRead(INP6) == LOW) {
    KP6 = 0;
  }
  else {
    KP6 = 1;
  }
  digitalWrite(OUT1, HIGH);

  digitalWrite(OUT2, LOW);
  if (digitalRead(INP1) == LOW) {
    KP7 = 0;
  }
  else {
    KP7 = 1;
  }
  if (digitalRead(INP2) == LOW) {
    KP8 = 0;
  }
  else {
    KP8 = 1;
  }
  if (digitalRead(INP3) == LOW) {
    KP9 = 0;
  }
  else {
    KP9 = 1;
  }
  if (digitalRead(INP4) == LOW) {
    KP10 = 0;
  }
  else {
    KP10 = 1;
  }
  if (digitalRead(INP5) == LOW) {
    KP11 = 0;
  }
  else {
    KP11 = 1;
  }
  if (digitalRead(INP6) == LOW) {
    KP12 = 0;
  }
  else {
    KP12 = 1;
  }
  digitalWrite(OUT2, HIGH);

  digitalWrite(OUT3, LOW);
  if (digitalRead(INP1) == LOW) {
    KP13 = 0;
  }
  else {
    KP13 = 1;
  }
  if (digitalRead(INP2) == LOW) {
    KP14 = 0;
  }
  else {
    KP14 = 1;
  }
  if (digitalRead(INP3) == LOW) {
    KP15 = 0;
  }
  else {
    KP15 = 1;
  }
  if (digitalRead(INP4) == LOW) {
    KP16 = 0;
  }
  else {
    KP16 = 16;
  }
  if (digitalRead(INP5) == LOW) {
    KP17 = 0;
  }
  else {
    KP17 = 1;
  }
  if (digitalRead(INP6) == LOW) {
    KP18 = 0;
  }
  else {
    KP18 = 1;
  }
  digitalWrite(OUT3, HIGH);

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.