I have 4x5 Matrix keypad and teensy 4.1.
When i have connected teensy 4.1 pin connected to row 6, 5, 4, 3, 2 and column 10, 9, 8, 7 all of my keypad is working properly. But when i change the pin and wiring connection of row 37, 36, 35, 34, 33 and column 29, 30, 31 and 32 keypad is not working below is my code.
Code:
#include <Keypad.h>
const byte ROWS = 5; //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'},
{'G','H','I','J'}
};
//byte rowPins[ROWS] = {6, 5, 4, 3, 2}; //connect to the row pinouts of the keypad
//byte colPins[COLS] = {10, 9, 8, 7}; //connect to the column pinouts of the keypad // Working perfectly
byte rowPins[ROWS] = {37, 36, 35, 34, 33}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {29, 30, 31, 32}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
void setup(){
Serial.begin(9600);
}
void loop(){
char customKey = customKeypad.getKey();
if (customKey){
Serial.println(customKey);
}
}
So please give me reply what is the problem? Is that i have to pull-up or pull-down register for keypad ?