@StefanL38 Die Pins sind jedsmal die selben, nur die Abfrage der Pins findet unterschiedlich statt.
hier mal die unterschiedlichen Varianten der Arays:
//MatrixConverter_v2.0.13_HW_v2.x_Cyberdine_Novomatic_1_gvul
const byte numRows = 8;
const byte numCols = 8;
const int keymap[numRows][numCols] = {
{115, 117, 119, 116, 111, 109, 105, 101},
{213, 999, 125, 113, 313, 104, 304, 204},
{206, 225, 998, 106, 306, 118, 318, 218},
{210, 202, 203, 207, 208, 214, 212, 220},
{215, 217, 219, 216, 211, 209, 205, 201},
{110, 102, 103, 107, 108, 114, 112, 120},
{310, 302, 303, 307, 308, 314, 312, 320},
{315, 317, 319, 316, 311, 309, 305, 301}
};
int rowPins[numRows] = {31, 29, 27, 25, 23, 22, 19, 17}; // Pin 1 bis 8
int colPins[numCols] = {15, 12, 11, 9, 7, 5, 3, 10}; // Pin 9 bis 16
//MatrixConverter_v2.0.13_HW_v2.x_Cyberdine_Novomatic_1_vul
const byte numRows = 8;
const byte numCols = 8;
const int keymap[numRows][numCols] = {
{115, 117, 119, 116, 111, 109, 105, 101},
{213, 999, 125, 113, 313, 104, 304, 204},
{206, 225, 998, 106, 306, 118, 318, 218},
{210, 202, 203, 207, 208, 214, 212, 220},
{215, 217, 219, 216, 211, 209, 205, 201},
{110, 102, 103, 107, 108, 114, 112, 120},
{310, 302, 303, 307, 308, 314, 312, 320},
{315, 317, 319, 316, 311, 309, 305, 301}
};
int rowPins[numRows] = {10, 3, 5, 7, 9, 11, 12, 15}; // Pin 1 bis 8
int colPins[numCols] = {17, 19, 22, 23, 25, 27, 29, 31}; // Pin 9 bis 16
//MatrixConverter_v2.0.13_HW_v2.x_GranBoard_62map_1_vul
const byte numRows = 7;
const byte numCols = 12;
const int keymap[numRows][numCols] = {
{113, 106, 110, 115, 112, 125, 302, 317, 303, 319, 116, 225},
{104, 306, 310, 315, 105, 996, 102, 117, 103, 119, 107, 997},
{313, 118, 110, 115, 305, 202, 102, 117, 103, 108, 307, 215},
{304, 106, 101, 120, 312, 217, 109, 114, 111, 119, 316, 210},
{113, 318, 301, 320, 105, 203, 309, 314, 311, 308, 107, 206},
{104, 118, 101, 120, 112, 219, 109, 114, 111, 108, 116, 213},
{204, 218, 201, 220, 212, 207, 209, 214, 211, 208, 216, 205}
};
int rowPins[numRows] = {31, 29, 27, 25, 23, 22, 19}; // Pin Pin 1, 2, 3, 4, 5, 6, 7
int colPins[numCols] = {17, 15, 12, 11, 7, 5, 3, 10, 8, 6, 4, 9}; // Pin 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 5
//MatrixConverter_v2.0.13_HW_v2.x_HiDarts_1_gvum
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 125, 302, 315, 310, 306, 313},
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 998, 304, 318, 301, 320, 305},
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 999, 312, 309, 314, 311, 308},
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 225, 316, 307, 319, 303, 317}
};
int rowPins[numRows] = {29, 31, 2, 4}; // Pin 19, 20, 1, 2
int colPins[numCols] = {6, 8, 10, 3, 5, 7, 9, 11, 12, 15, 17, 19, 22, 23, 25, 27}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_1_gvul
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 125, 302, 315, 310, 306, 313},
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 998, 304, 318, 301, 320, 305},
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 999, 312, 309, 314, 311, 308},
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 225, 316, 307, 319, 303, 317}
};
int rowPins[numRows] = {29, 31, 2, 4}; // Pin 19, 20, 1, 2
int colPins[numCols] = {6, 8, 10, 3, 5, 7, 9, 11, 12, 15, 17, 19, 22, 23, 25, 27}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_1_vul
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 125, 302, 315, 310, 306, 313},
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 998, 304, 318, 301, 320, 305},
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 999, 312, 309, 314, 311, 308},
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 225, 316, 307, 319, 303, 317}
};
int rowPins[numRows] = {4, 2, 31, 29}; // Pin 19, 20, 1, 2
int colPins[numCols] = {27, 25, 23, 22, 19, 17, 15, 12, 11, 9, 7, 5, 3, 10, 8, 6}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_2_gvlo
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 125, 316, 307, 319, 303, 317},
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 999, 302, 315, 310, 306, 313},
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 998, 304, 318, 301, 320, 305},
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 225, 312, 309, 314, 311, 308}
};
int rowPins[numRows] = {29, 31, 2, 4}; // Pin 19, 20, 1, 2
int colPins[numCols] = {6, 8, 10, 3, 5, 7, 9, 11, 12, 15, 17, 19, 22, 23, 25, 27}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_2_vlo
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 125, 316, 307, 319, 303, 317},
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 999, 302, 315, 310, 306, 313},
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 998, 304, 318, 301, 320, 305},
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 225, 312, 309, 314, 311, 308}
};
int rowPins[numRows] = {4, 2, 31, 29}; // Pin 19, 20, 1, 2
int colPins[numCols] = {27, 25, 23, 22, 19, 17, 15, 12, 11, 9, 7, 5, 3, 10, 8, 6}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_3_gvor
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 125, 312, 309, 314, 311, 308},
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 998, 316, 307, 319, 303, 317},
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 999, 302, 315, 310, 306, 313},
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 225, 304, 318, 301, 320, 305}
};
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_3_vor
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 125, 312, 309, 314, 311, 308},
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 998, 316, 307, 319, 303, 317},
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 999, 302, 315, 310, 306, 313},
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 225, 304, 318, 301, 320, 305}
};
int rowPins[numRows] = {4, 2, 31, 29}; // Pin 19, 20, 1, 2
int colPins[numCols] = {27, 25, 23, 22, 19, 17, 15, 12, 11, 9, 7, 5, 3, 10, 8, 6}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_4_gvru
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 125, 304, 318, 301, 320, 305},
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 999, 312, 309, 314, 311, 308},
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 998, 316, 307, 319, 303, 317},
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 225, 302, 315, 310, 306, 313}
};
int rowPins[numRows] = {29, 31, 2, 4}; // Pin 19, 20, 1, 2
int colPins[numCols] = {6, 8, 10, 3, 5, 7, 9, 11, 12, 15, 17, 19, 22, 23, 25, 27}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Loewen_Compumatic_4_vru
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{204, 104, 218, 118, 201, 101, 220, 120, 205, 105, 125, 304, 318, 301, 320, 305},
{212, 112, 209, 109, 214, 114, 211, 111, 208, 108, 999, 312, 309, 314, 311, 308},
{216, 116, 207, 107, 219, 119, 203, 103, 217, 117, 998, 316, 307, 319, 303, 317},
{202, 102, 215, 115, 210, 110, 206, 106, 213, 113, 225, 302, 315, 310, 306, 313}
};
int rowPins[numRows] = {4, 2, 31, 29}; // Pin 19, 20, 1, 2
int colPins[numCols] = {27, 25, 23, 22, 19, 17, 15, 12, 11, 9, 7, 5, 3, 10, 8, 6}; // Pin 3 bis 18
//MatrixConverter_v2.0.13_HW_v2.x_Merkur_1_vul
const byte numRows = 4;
const byte numCols = 16;
const int keymap[numRows][numCols] = {
{113, 213, 313, 106, 206, 306, 110, 210, 310, 115, 215, 315, 104, 204, 304, 998},
{101, 201, 301, 120, 220, 320, 105, 205, 305, 112, 212, 312, 118, 218, 318, 125},
{108, 208, 308, 111, 211, 311, 114, 214, 314, 109, 209, 309, 116, 216, 316, 999},
{119, 219, 319, 103, 203, 303, 117, 217, 317, 102, 202, 302, 107, 207, 307, 225}
};
int rowPins[numRows] = {27, 25, 31, 29}; // Pin 3, 4, 1, 2
int colPins[numCols] = {23, 22, 19, 17, 15, 12, 11, 9, 7, 5, 3, 10, 8, 6, 4, 2}; // Pin 5 bis 20
diese werden wenn das Aray am Anfang definiert ist im folgenden so abgefragt:
int getKey() {
int key = 0;
for(int column = 0; column < numCols; column++) {
digitalWrite(colPins[column],LOW);
for(int row = 0; row < numRows; row++) {
if(digitalRead(rowPins[row]) == LOW) {
delay(intDebounceTime);
key = keymap[row][column];
Serial.print(F("MATRIXV1"));
Serial.println(key);
Serial1.print(F("MATRIXV1"));
Serial1.println(key);
ich hoffe, das ich damit deine Fragen / Verständnisprobleme erklären konnte.
Die Auswahl der Matrix / Array soll einmalig am Anfang stattfinden und auf dem gespeicherten wert im Eeprom beruhen.
Also initial einmal auswählen, und dann in der Zukunft immer diese eine Matrix / Array nutzen.