Greetings to all of you
my problem is related to a specific library, possible to download from the arduino platform itself "Keypad by Mark Stanley, Alexander Breving Version 3.1.1."
the project im working on requires a keypad matrix that has 1 digit numbers/values stored/assignes to the keys 2 digit numbers/values stored/assignes to the keys and also 3 digit numbers/values stored/assigned to the keys.
with that library im unable to use 2 digits values ( like 10, 11, 12, 40, 60,...) and 3 digitvalues ( like 180, and so on).
as my skills in programing the code are more or less, less basic im not able to come to a solution. therefore i turn myself to the community, and all others that might have an answer to my situation.
down below is the code i used to do a test.
is it possible to fix that with some datatype changes? or am i doomed?
#include <Keypad.h>
const byte ROWS1 = 1;
const byte COLS1 = 7;
char keys1[ROWS1][COLS1] = {
{'1','2','3','4','5','6','7'},
};
byte rowPins1[ROWS1] = {40}; //connect to the row pinouts of the keypad
byte colPins1[COLS1] = {41, 43, 45, 47, 49, 51, 53}; //connect to the column pinouts of the keypad
Keypad keypad1 = Keypad( makeKeymap(keys1), rowPins1, colPins1, ROWS1, COLS1 );
const byte ROWS2 = 1;
const byte COLS2 = 7;
char keys2[ROWS2][COLS2] = {
{'8','9','10','11','12','13'},
};
byte rowPins2[ROWS2] = {42}; //connect to the row pinouts of the keypad
byte colPins2[COLS2] = {41, 43, 45, 47, 49, 51, 53}; //connect to the column pinouts of the keypad
Keypad keypad2 = Keypad( makeKeymap(keys2), rowPins2, colPins2, ROWS2, COLS2 );
void setup(){
Serial.begin(9600);
}
void loop(){
char key1 = keypad2.getKey();
if (key1){
Serial.println(key1);
}
char key2 = keypad2.getKey();
if (key2){
Serial.println(key2);
}
}