 char pin[3];
 char val[4];
 char aux[4];
-
-
 
 Servo servo;
 

  if(p == -1) { if(debug) Serial.println("badpin"); return; }
  Serial.println("got signal");

  if (atoi(val) == 0) {
    servo.detach();
    char m[12];
    sprintf(m, "%s::detached", pin);
    Serial.println(m);
  } else if (atoi(val) == 1) {
    servo.attach(p, 100, 2200);
    char m[12];
    sprintf(m, "%s::attached", pin);
    Serial.println(m);
  } else if (atoi(val) == 2) {
    Serial.println("writing to servo");
    Serial.println(atoi(aux));

    // digitalWrite(pin, HIGH);   // start the pulse
    // delayMicroseconds(pulseWidth);  // pulse width
    // digitalWrite(pin, LOW);    // stop the pulse

  // 03(3) Read
  } else if (atoi(val) == 3) {
    Serial.println("reading servo");
    int sval = servo.read();
    char m[13];
    sprintf(m, "%s::read::%03d", pin, sval);
    Serial.println(m);
  }
