interfacing keypad

How to interface keypad with esp8266.
I am writing below code in arduino ide
and it is providing garbage value in serial monitor.
Has anyone worked on esp8266 keypad interface with arduino ide?Please help.

#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{‘0’,‘1’,‘2’,‘3’},
{‘4’,‘5’,‘6’,‘7’},
{‘8’,‘9’,‘a’,‘b’},
{‘c’,‘d’,‘e’,‘f’}
};
byte rowPins[ROWS] = {16, 5, 4, 14}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {12, 13, 3, 1}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad cusomKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup(){
Serial.begin(9600);
}

void loop(){
char customKey = cusomKeypad.getKey();

if (customKey != NO_KEY){
Serial.println(customKey);
}
}

byte colPins[COLS] = {12, 13, 3, 1}; //connect to the column pinouts of the keypad

Having one of the column pins on the hardware serial port pin WILL cause problems with sending and receiving serial data.

means having 1 as a hardware pin u want to say

May I suggest an alternative keypad interface. I2C keypad for 8266.

i2ckeypad library
I2C Port Expander And Keypads

means having 1 as a hardware pin u want to say

You can't change the fact that pin 1 is a hardware serial pin. You can change the fact that you have the keypad connected to that pin.

Change what you can; accept what you can't change.

Also, on the ESP8266, pin 3 is RX0 (hardware RX).

  1. TX0
  2. TX1
  3. RX0

From esp8266_gpio_pin_allocations