    if(!btSerial.available())
      return;
    char c = btSerial.read();
-   if(c == '\n' || c == '\r') { 
+   if(c == '\n' || c == '\r') {
      process_cmd();
      last_cmd_ms = ms;
    }


void setup()
{
  pinMode(PANEL_PIN, OUTPUT);  
  pinMode(RED_PIN, OUTPUT);  
  pinMode(GREEN_PIN, OUTPUT);  
  pinMode(BLUE_PIN, OUTPUT);  
  pinMode(SPEAKER_PIN, OUTPUT);
  digitalWrite(PANEL_PIN, LOW);
  digitalWrite(RED_PIN, LOW);
  digitalWrite(GREEN_PIN, LOW);
  digitalWrite(BLUE_PIN, LOW); 
  Serial.begin(115200);
  btSerial.begin(9600);
}

       stop_beep_ms = millis() + arg;
       btSerial.println("OK");
       break;

     case 'K': // read knob pos
       char resp[5];
       snprintf(resp, 5, "%04d", knob_pos);
       btSerial.println(resp);
       break;

     case 'P': // ping!
       btSerial.println("OK");
       break;

      default:
        Serial.println("Got garbage command!");
        Serial.println(cmd_buf);
   }
   memset(cmd_buf, 0, cmd_buf_len);
}
