#include <SD.h>                      // need to include the SD library
//#define SD_ChipSelectPin 53  //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 4  //using digital pin 4 on arduino nano 328, can use other pins
#include <TMRpcm.h>           //  also need to include this library...
#include <SPI.h>
#include <Keypad.h>

TMRpcm tmrpcm;   // create an object for use in this sketch

unsigned long time = 0;


const byte ROWS = 3;
const byte COLS = 3;

// how the keypad has its keys laid out
const char keys[ROWS][COLS] = {
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
};

const byte colPins[COLS] = {2, 3, 4}; //connect to the column pinouts of the keypad
const byte rowPins[ROWS] = {5, 6, 7}; //connect to the row pinouts of the keypad

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

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  tmrpcm.speakerPin = 9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
  //Complimentary Output or Dual Speakers:
  //pinMode(10,OUTPUT); Pin pairs: 9,10 Mega: 5-2,6-7,11-12,46-45 
}

void loop() {
  // put your main code here, to run repeatedly:
  // kpd.scan ();
  char key = keypad.getKey();
  
  if (key){
    Serial.println(key);
  }
}