 
   int noteDuration = 1000/8;
    
-  char key = kpd.getKey();
-  int reading = digitalRead(key);
-
+  char keyA = kpdA.getKey();
+  char keyB = kpdB.getKey();
   
-  if(key)  // Check for a valid key.
+//  int reading = digitalRead(key);
+
+  
+  if(keyA)  // Check for a valid key.
   {
-    Serial.println(reading);
-    switch (key)
+//    Serial.println(reading);
+    switch (keyA)
     {
       // to calculate the note duration, take one second 
       // divided by the note type.

        tone(melodyPin, NOTE_B3,noteDuration);
        delay(125);
        tone(melodyPin, NOTE_C3,noteDuration);
        break;
      case '2':
        tone(melodyPin, NOTE_B3,noteDuration);
        break;
      case '3':
        tone(melodyPin, NOTE_C4,noteDuration);
        break;
      case '4':
        tone(melodyPin, NOTE_D4,noteDuration);
        break;
      case '5':
        tone(melodyPin, NOTE_E4,noteDuration);
        break;
      case '6':
        tone(melodyPin, NOTE_F4,noteDuration);
        break;
      case '7':
        tone(melodyPin, NOTE_G4,noteDuration);
        break;
      case '8':
        tone(melodyPin, NOTE_A4,noteDuration);
        break;
      case '9':
//        tone(melodyPin, NOTE_B4,noteDuration);
//        int size = sizeof(underworld_melody) / sizeof(int);
        for (int thisNote = 0; thisNote < 8; thisNote++) {
     
          // to calculate the note duration, take one second
          // divided by the note type.
          //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.

     
          // stop the tone playing:
          tone(4, 0, noteDuration);
        }
        Serial.println("0");
        break;
        
      case '*':
        count++;
        if (count%2==1)
            analogWrite(motorPin, 200); 
        else
            analogWrite(motorPin, 0);
        Serial.println("*");
        break;
      case '#':
        analogWrite(motorPin, 0);
        Serial.println("#");
        break;
      default:
        Serial.println(keyA);

    }
  }

  if (keyB){

    switch(keyB){

      case 'a':
        Serial.println("a");
        break;
      case 'b':
        Serial.println("b");
        break;
      case 'c':
        Serial.println("c");
        break;
      default:
        Serial.println(keyB);
    }
  }
}
