Not reading keypad matrix

I’m making a device that will play an audio file when you push a button. A button corresponds to which audio file to play.

Because I could not use a regular matrix keypad in this application (buttons have to be spread out), I configured my own using tactile switches.

When I first assembled it, only 2 buttons worked: S13 and S14, but the program though they were 3 and 4. Played audio just fine though, everything else works but the reading the switches.

Using a standalone 328, BTW.

Messing with the code a bit to switch the rows and colums around, now it never picks up on a switch.

Thoughts?

Here is my full code, pic attached of schematic of how the switches are (had a PCB made using KiCad)

#include <DFRobotDFPlayerMini.h>
#include <Keypad.h>
#include <SoftwareSerial.h>

SoftwareSerial mySoftwareSerial(10, 11);
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);

const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] = {
  {'S1', 'S7', 'S13'},
  {'S2', 'S8', 'S14'},
  {'S3', 'S9', 'S15'},
  {'S4', 'S10', 'S16'}
};
byte rowPins[ROWS] = {2, 3, 4, 5};
byte colPins[COLS] = {A5, A4, A3};
const byte pwrFet = A2;
const byte busyPin = 9;
unsigned long currentTime;






Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup() {
  pinMode(pwrFet, OUTPUT);
  digitalWrite(pwrFet, HIGH);
  pinMode(busyPin, INPUT_PULLUP);//if issues with busy signal, install pull down resistor and change to regular input
  mySoftwareSerial.begin(9600);
  Serial.begin(9600);
  delay(10);


  //Serial.println();
  Serial.println(F("DFRobot DFPlayer Mini"));
  Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)"));

  if (!myDFPlayer.begin(mySoftwareSerial)) {  //Use softwareSerial to communicate with Mp3.
    Serial.println(F("Unable to begin:"));
    Serial.println(F("1.Please recheck the connection!"));
    Serial.println(F("2.Please insert the SD card!"));
    //while (true);
  }
  myDFPlayer.setTimeOut(500);
  myDFPlayer.volume(20);
  myDFPlayer.EQ(DFPLAYER_EQ_NORMAL);
  myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD);
  Serial.print(F("Total Songs on SD Card:  "));
  Serial.print(myDFPlayer.readFileCounts()); //read all file counts in SD card


 




}

void loop() {
  //TIMER();




  char key = keypad.getKey();

  if (key) {
    switch (key)
    {
      case 'S1':
        myDFPlayer.playFolder(1, 1);
        Serial.println(F("button S1 depressed"));
        break;
      case 'S2':
        myDFPlayer.playFolder(1, 2);
        Serial.println(F("button S2 depressed"));
        break;
      case 'S3':
        myDFPlayer.playFolder(1, 3);
        Serial.println(F("button S3 depressed"));
        break;
      case 'S4':
        myDFPlayer.playFolder(1, 4);
        Serial.println(F("button S4 depressed"));
        break;
      case 'S7':
        myDFPlayer.playFolder(1, 5);
        Serial.println(F("button S7 depressed"));
        break;
      case 'S8':
        myDFPlayer.playFolder(1, 6);
        Serial.println(F("button S7 depressed"));
        break;
      case 'S9':
        myDFPlayer.playFolder(1, 7);
        Serial.println(F("button S9 depressed"));
        break;
      case 'S10':
        myDFPlayer.playFolder(1, 8);
        Serial.println(F("button S10 depressed"));
        break;
      case 'S13':
        myDFPlayer.playFolder(1, 9);
        Serial.println(F("button S13 depressed"));
        break;
      case 'S14':
       myDFPlayer.playFolder(1, 10);
        Serial.println(F("button S14 depressed"));
        break;
      case 'S15':
        myDFPlayer.playFolder(1, 11);
        Serial.println(F("button S15 depressed"));
        break;
      case 'S16':
       myDFPlayer.playFolder(1, 12);
        Serial.println(F("button S16 depressed"));
        break;
     

    }

  }

}
void SHUTDOWN()
{
  digitalWrite(pwrFet, LOW);
  Serial.println(F("System Idle; Shutting Down"));//should never see this in circuit, debugging only
}

void TIMER()
{
  int busy = digitalRead(busyPin);
  if (busy == HIGH ) {
    if (millis() - currentTime > 5000) {
      SHUTDOWN();
    }
  }
  if (busy == LOW) {
    currentTime = millis();
    //digitalWrite(pwrFet, HIGH);// comment out once code final, as it won't be useful
    Serial.println(F("Timer Reset"));
  }
}

Re-read some of the Keypad example sketches and pay attention to how your keys array is declared. Each element of the array must be a single character. A char variable of 1 byte size cannot hold 'S1' etc. of 2 bytes.

arduarn:
Re-read some of the Keypad example sketches and pay attention to how your keys array is declared. Each element of the array must be a single character. A char variable of 1 byte size cannot hold 'S1' etc. of 2 bytes.

And a hundred internet thank you's to you good sir!

Working perfectly now after I re-defined everything alphabetically.