//=====KEYPAD=====
#include <Keypad.h>
// Define the keypad
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
  { '1', '2', '3', 'A' },
  { '4', '5', '6', 'B' },
  { '7', '8', '9', 'C' },
  { '*', '0', '#', 'D' }
};
// byte rowPins[ROWS] = { 49, 47, 45, 43 };  // Connect to the row pinouts of the keypad
// byte colPins[COLS] = { 41, 39, 37, 35 };  // Connect to the column pinouts of the keypad
byte rowPins[ROWS] = { 35, 37, 39, 41 };  // Connect to the row pinouts of the keypad
byte colPins[COLS] = { 43, 45, 47, 49 };  // Connect to the column pinouts of the keypad
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
char keypress;                            // Key that has been pressed.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);

  Serial.println("\nKeypad Test Ready");
}

void loop() {
  // put your main code here, to run repeatedly:
  // Serial.println("loop");
  keypress = keypad.getKey();
  if (keypress) {
    Serial.print("key pressed: ");
    Serial.println(keypress);
  }
  delay(50);
}
