Currently working through figuring out the matrix.
In the past I've tried tracing it out on the computer and I've also tried tracing it out using a multimeter. This time I wanted to speed it up so I wrote this little arduino sketch to help. Works great and I've learned something new! Even found a dead switch that needs replacing.
Code: Select all
byte cols[] = {0,1,2,3,4,5,6,7};
const int colCount = sizeof(cols)/sizeof(cols[0]);
byte rows[] = {8,9,10,11,12,13,14,15,16,17,18,19,20};
const int rowCount = sizeof(rows)/sizeof(rows[0]);
void setup() {
for (int x=0; x<colCount; x++) {
pinMode(cols[x], INPUT_PULLUP);
}
for(int x=0; x<rowCount; x++) {
pinMode(rows[x], INPUT);
}
Serial.begin(115200);
}
void loop() {
// Iterate rows
for (int rowIndex=0; rowIndex < rowCount; rowIndex++) {
// Current row
byte curRow = rows[rowIndex];
pinMode(curRow, OUTPUT);
digitalWrite(curRow, LOW);
// Iterate columns
for (int colIndex=0; colIndex < colCount; colIndex++) {
// Current col
byte curCol = cols[colIndex];
if(digitalRead(curCol) == LOW) {
// Hit!
Serial.print("Row: ");
Serial.print(rowIndex);
Serial.print(" | Col: ");
Serial.println(colIndex);
}
}
pinMode(curRow, INPUT);
}
}