void getKeys() {
  for (int i = 2; i < 6; ++i) {
    pinMode(i, OUTPUT);
    digitalWrite(i, LOW);
    for (int j = 6; j < 10; ++j) {
      pinMode(j, INPUT_PULLUP);
      if (!digitalRead(j)) {
        Serial.print(j - 5);
        Serial.print(',');
        Serial.print(i - 1);
        Serial.println(" pressed.");
        delay(100);
      }
    }
    digitalWrite(i, HIGH);
  }
}

void setup() {
  Serial.begin(115200);
}

void loop() {
  getKeys();
  delay(10);
}
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout
DIODEBreakout