 || * 8-ohm speaker on digital pin 5
 ||
 || @description
-|| |    Debug/test of generic buffer
+|| |    This sketch gives an example of how to read integers,
+|| | floats, longs and strings with the Keypad library.
 || |
 || #
 */

  kpd.addEventListener(key_event_handler);
}

float f, oldf=0;
int i, oldi=0;
long l, oldl=0;

void loop() {
  kpd.getKey();

    Serial.print("\r\n"); 
  }
  
  if(kpd.readQueue(TYPE_STRING, str) && strncmp(str, oldstr, buffer_length)!=0) {
    strncpy(oldstr, str, buffer_length);
    Serial.print("str = \"");
    Serial.print(str);
    Serial.print("\"\r\n"); 
  }
  
  /* Below we make the buffer expiring after 4 seconds of inactivity */
  if(lastPress + 4000 < millis()) {
    kpd.resetKeysInQueue();
    Serial.print("Queue cleared for inactivity\r\n");
  }
}
