   bool done;
   byte n;
   byte i;
-  
+
   strip.setPixelColor(0, strip.Color(255,0,0));
   strip.setPixelColor(1, strip.Color(0,255,0));
   strip.setPixelColor(2, strip.Color(0,0,255));
   strip.setPixelColor(3, strip.Color(0,255,255));
   strip.show();
-  
+
   while(1){
     done = false;
     switch (pattern){
 
       case 0:  // display r, g and b from master
-      while(!done){
-        red = msg[14];
-        green = msg[15];
-        blue = msg[16];
-        strip.setPixelColor(0, strip.Color(red, green, blue));
-        strip.setPixelColor(1, strip.Color(red, green, blue));
-        strip.setPixelColor(2, strip.Color(red, green, blue));
-        strip.setPixelColor(3, strip.Color(red, green, blue));
-        strip.show();
-        //delay(rate);      
-        if(check_radio()){done = process_msg();}   
-        if (millis() > timeout){
-          timeout = millis()+60000;
-          pattern = 2;
-          done = true;
-        }  
-      }
-      break;
- 
-     case 1:  // color rotating around circle
-      n = (addr-1) * 16;
-      while (!done){
-        if (n<16){
-          strip.setPixelColor(0, strip.Color(255,0,0));
-          strip.setPixelColor(1, strip.Color(255,0,0));
-          strip.setPixelColor(2, strip.Color(255,0,0));
-          strip.setPixelColor(3, strip.Color(255,0,0));
-          strip.show();          
+        while(!done){
+          red = msg[14];
+          green = msg[15];
+          blue = msg[16];
+          strip.setPixelColor(0, strip.Color(red, green, blue));
+          strip.setPixelColor(1, strip.Color(red, green, blue));
+          strip.setPixelColor(2, strip.Color(red, green, blue));
+          strip.setPixelColor(3, strip.Color(red, green, blue));
+          strip.show();
+          //delay(rate);
+          if(check_radio()){done = process_msg();}
+          if (millis() > timeout){
+            timeout = millis()+60000;
+            pattern = 2;
+            done = true;
+          }
         }
-        else
-        {
-          strip.setPixelColor(0, strip.Color(0,0,255));
-          strip.setPixelColor(1, strip.Color(0,0,255));
-          strip.setPixelColor(2, strip.Color(0,0,255));
-          strip.setPixelColor(3, strip.Color(0,0,255));
-          strip.show();
+        break;
+
+      case 1:  // color rotating around circle
+        n = (addr-1) * 16;
+        while (!done){
+          if (n<16){
+            strip.setPixelColor(0, strip.Color(255,0,0));
+            strip.setPixelColor(1, strip.Color(255,0,0));
+            strip.setPixelColor(2, strip.Color(255,0,0));
+            strip.setPixelColor(3, strip.Color(255,0,0));
+            strip.show();
+          }
+          else
+          {
+            strip.setPixelColor(0, strip.Color(0,0,255));
+            strip.setPixelColor(1, strip.Color(0,0,255));
+            strip.setPixelColor(2, strip.Color(0,0,255));
+            strip.setPixelColor(3, strip.Color(0,0,255));
+            strip.show();
+          }
+          n++;
+          if(check_radio()){done = process_msg();}
+          if (millis() > timeout){
+            timeout = millis()+60000;
+            pattern = 2;
+            done = true;
+          }
+          delay(rate);
         }
-        n++;
-        if(check_radio()){done = process_msg();}
-        if (millis() > timeout){
-          timeout = millis()+60000;
-          pattern = 2;
-          done = true;
-        }  
-        delay(rate);
-      }
-      break;
-
-     case 2:  // rainbow rotating around
-      n = (addr-1) * 16;
-      while (!done){
+        break;
+
+      case 2:  // rainbow rotating around
+        n = (addr-1) * 16;
+        while (!done){
           for(i=0; i< strip.numPixels(); i++) {
             strip.setPixelColor(i, Wheel((64 + n) & 255));
           }
           strip.show();
           delay(rate);
-        n++;
-        if(check_radio()){done = process_msg();}
-        if (millis() > timeout){
-          timeout = millis()+60000;
-          pattern = 2;
-          done = true;
-        }  
-        delay(rate);
-      }     
-      break;
-
-     default:
-      pattern = 2;
-    }
-  
-  }
-  
+          n++;
+          if(check_radio()){done = process_msg();}
+          if (millis() > timeout){
+            timeout = millis()+60000;
+            pattern = 2;
+            done = true;
+          }
+          delay(rate);
+        }
+        break;
+
+      default:
+        pattern = 2;
+    }
+
+  }
+
 }
 
 // Input a value 0 to 255 to get a color value.


#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"

void setup(void){

  Serial.begin(57600);
  //  printf_begin();

  radio.begin();
  radio.setAutoAck(0);
  //  radio.printDetails();
  radio.openReadingPipe(1,pipe);
  radio.startListening();

  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

  timeout = millis() + 10000;

}
