#include <Keypad.h>
const int rows1 = 4;
const int cols1 = 4;
const int rows2 = 4;
const int cols2 = 4;
char panel;
char Keys1[rows1][cols1] = {
{'m', 'i', 'e', 'A'},
{'n', 'j', 'f', 'B'},
{'o', 'k', 'g', 'C'},
{'p', 'l', 'h', 'D'}
};
char Keys2[rows2][cols2] = {
{'#', 'y', 'u', 'q'},
{'$', 'z', 'v', 'r'},
{'%', '@', 'w', 's'},
{'*', '&', 'x', 't'}
};
uint8_t rowpins1[rows1] = {13, 12, 14, 27}; //{13, 12, 14, 27};
uint8_t colpins1[cols1] = {26, 25, 33, 32}; //{26, 25, 33, 32};
uint8_t rowpins2[rows2] = {23, 22, 21, 19}; //{13, 12, 14, 27};
uint8_t colpins2[cols2] = {18, 5, 17, 16}; //{26, 25, 33, 32};
Keypad keypads1 = Keypad(makeKeymap(Keys1), rowpins1, colpins1, rows1, cols1);
Keypad keypads2 = Keypad(makeKeymap(Keys2), rowpins2, colpins2, rows2, cols2);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
// char key1 = keypads1.getKey();
// char key2 = keypads2.getKey();
// Serial.print("KEYS 1 : ");
// Serial.println(key1);
// Serial.print("KEYS 2 : ");
// Serial.println(key2);
panel = keypads1.getKey() && keypads2.getKey();
Serial.print("panel : ");
Serial.println(panel);
delay(100); // this speeds up the simulation
}