 void readIncommingNodeData() {
   // READ RESPONSE
   if( NodeSerial.available() ) {
-    // 1. empty incomingByte:
+    // empty incomingByte:
     incomingByte = 0x00;
 
-    // 2. read first byte:
+    // read first byte:
     incomingByte = NodeSerial.read();
-
-    // 3. read the rest of the buffer so that it's empty
+    
+    if(incomingByte == 255) {
+      turnOffMonitoring();
+      if(debug) Serial.print("turn off monitoring");
+    }else{
+      // do something with the channel:
+      int channel = incomingByte;
+      if(debug) Serial.print("do something with channel ");
+      if(debug) Serial.println(channel, DEC);
+    }
+
+    // read the rest of the buffer so that it's empty
     while(NodeSerial.available())
     {
       NodeSerial.read();
     }
-
-    if(incomingByte != 0x00)
-    {
-      if(debug) Serial.print("> incomingByte:");
-      if(debug) Serial.println(incomingByte);
-      
-      if (incomingByte == 97){ //97='a' in ASCII
-        digitalWrite(ledPins[0], HIGH);
-      }else{
-        digitalWrite(ledPins[0], LOW);
-      }
-    }
-  }
-}
-
-
-
-
+  }
+}
+
+void turnOffMonitoring() {
+  
+}
+
+
+
+

    
    // register every led pin as output:
    pinMode(ledPins[pin], OUTPUT);
    
    while (!Serial);
    Serial.println(nrOfConsecutiveSilenceSamplesBeforeFlippingToSilence[pin]);
  }
  
  while (!NodeSerial); //hang till NodeSerial is up

      checkSoundState(pin, soundValues[pin]);
      
      // send sound level (if required):
      if(pin == 0)
        sendSoundLevel(pin, soundValues[pin]);
    }
  }
  
