Greetings, I am using esp32 with arduino IDE and membrane 4x3 keypad, I want to read keypad input, I use <Keypad.h> in the playground, i connect my keypad as the following:
r1 r2 r3 r4 -> (13, 12, 14, 27)
c1 c2 c3 -> (26, 25, 33)
the first time i connected it, the entire first column didn't work, then i soldered it to make sure it's not connection problems, it worked fine for 5 hours then it started repeating the first column keys (1,4,7,*) on hold (when i hold the first column keys), i tried so far about 5 keypads both 4x3 and 4x4, the same problem, sometimes work sometimes no, i changed breadboard, changed pins, changed wires, changed keypad, now i am left with changing the library or the esp thought i am pretty sure esp32 is working fine (used it with ultrasonic on the same pins)
this is my code:
#include <Keypad.h>// Keypad library
const byte ROWS = 4; // number of keypad rows
const byte COLS = 3; // number of keypad columns
char keys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
byte rowPins[ROWS] = {13, 12, 14, 27}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {26, 25, 33}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
char key = keypad.getKey();
if (key != NO_KEY) {
Serial.println(key);
}
}
and i don't use any external power resource, i tried to reinstall the library several times with no change
also it's not the keypad that is not working, sometimes it doesn't work then after a while it works
what would be the reason? could it be library problem? what other libraries I can try?