 }
 
 void sendPingReply() {
+    writeRGBColor(YELLOW);        
+
     OSCMessage m("/exo/tt/ping/reply");
     m.add((int32_t) micros());
     
-    sendOSC(m);  
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-OSCMessage messageIn;
-
+    sendOSC(m);
+    
+    writeRGBColor(GREEN);        
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+  
 void loop() {    
 #ifdef USE_BLUETOOTH
-    // this must be kept in loop() to receive events via Amarino
-    //meetAndroid.receive();  
-
-    if (int size = SLIPSerial.available() > 0) {
+    int done = SLIPSerial.endofPacket();
+    
+    int size;
+    OSCMessage messageIn;
+    while ((size = SLIPSerial.available()) > 0) {
+        writeRGBColor(GRAY);
+
         while (size--) {
-            messageIn.fill(SLIPSerial.read());
-            
-            // note: we may start writing before we are done reading available bytes
-            if (SLIPSerial.endofPacket()) {
-                receiveOSCMessage(messageIn);
-            }
+            int c = SLIPSerial.read();
+            messageIn.fill(c);
+            //sprintf(errstr, "received a byte: %d. bytes: %d, size: %d, hasError: %d", c, messageIn2.bytes(), messageIn2.size(), messageIn2.hasError());
+            //sendInfo(errstr);
         }
     }
+    done = done || SLIPSerial.endofPacket();
+    if (done) {
+        if (messageIn.hasError()) {
+            sendOSCMessageError(messageIn);
+        } else {
+            receiveOSCMessage(messageIn);       
+        }
+        
+        messageIn.empty();
+    }
 #endif
-
+    writeRGBColor(BLACK);
+    
     readKeys();
     
     if (keyState != lastKeyState) {
         colorDebug();
-//sprintf(errstr, "input changed from %d to %d\n", lastKeyState, keyState);
-//ƒsendInfo(errstr);  
         
         // bells and whistles
         if (keys[4] == HIGH) {


void receiveVibroMessage(class OSCMessage &m) {
    writeRGBColor(PURPLE);
  //sendInfo("we made it into the vibro control!");
    if (m.isInt(0)) {
        int d = m.getInt(0);

////////////////////////////////////////////////////////////////////////////////

void receiveMorseMessage(class OSCMessage &m) {
  //sendInfo("received morse message");
    if (m.isString(0)) {
        writeRGBColor(YELLOW);
        
        int length = m.getDataLength(0);
        char buffer[length+1];
        m.getString(0, buffer, length+1);   
        
        playMorseString(buffer, morseStopTest); 
    } else {
        sendError("expected string argument to Morse code control");
    }  
}

void receivePhotoGetMessage(class OSCMessage &m) {
    writeRGBColor(WHITE);    
    
    sampler_photoresistor.reset();
    sampler_photoresistor.beginSample();
    sampler_photoresistor.measure();
