  * Handle Ping commands
  * fire, read
  */
-void handlePing(char *pin, char *val, char *aux) {
-  int p = getPin(pin);
-  if (p == -1) return;
-  
+void handlePing(int p, char *val, char *aux) {  
   // 01(1) Fire and Read
   if (atoi(val) == 1) {
     char m[16];

/*
 * Set pin mode
 */
void setMode(char *pin, char *val) {
  int p = getPin(pin);
  if (p == -1) return;
  if (atoi(val) == 0) {
    pinMode(p, OUTPUT);
  } else {

  }

  // if (debug) Serial.println(request);
  
  int p = getPin(pin);
  if (p == -1) return; // Should raise some kind of "bad pin" error.
  
  
  int cmdid = atoi(cmd);

  switch(cmdid) {
    case 0:  setMode    (p, val);       break;
    case 1:  dWrite     (p, val);       break;
    case 2:  dRead      (p);            break;
    case 3:  aWrite     (p, val);       break;
    case 4:  aRead      (p);            break;
    case 97: handlePing (p, val, aux);  break;
    case 98: handleServo(p, val, aux);  break;
    case 99: toggleDebug(val);          break;
    default:                            break;
  }
}

