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);
}
}