 const int BAUD = 9600;
 
 const int nLEDs = 32; // Number of LEDs in strand
-const int dataPin  = 2;
-const int clockPin = 3;
+const int dataPin  = 2; // Output pins to the LPD8806
+const int clockPin = 3; // Output pins to the LPD8806
+const int buttonPin = 6;// the number of the input pin
+
 const int frameDuration = 25; // ms to display each frame of animation
+const int counterLimit = 10240; // we don't need to track the number of loop executions up to infinity, once it hits this number it starts back at zero.
 int counter = 0; // keeps track of the number of times we've executed loop
-const int counterLimit = 10240; // we don't need to track the number of loop executions up to infinity, once it hits this number it starts back at zero.
 int maxParticles = 5;
 int maxLeadingCorona = (nLEDs/2)-1;
 int maxTrailingCorona = (nLEDs/2)-1;
-LPD8806 strip = LPD8806(32, dataPin, clockPin);
+
+LPD8806 strip = LPD8806(32, dataPin, clockPin); // Init the strip
+
+int particleParamSetCount = 5;		// number of sets of particle parameters
+int currentParticleParamSet = 1;	// which of those particle parameter sets are currently active
+int ringParamSetCount = 5;			// number of sets of ring parameters
+int currentRingParamSet = 1;		// which of those ring parameter sets are currently active
+
+int PARTICLE = 1;
+int RING = 2;
+
+int mode = RING;
+// int mode = PARTICLE;
 
 /* 
  * array stores 16 parameters per particle. In order these represent:

    
    counter++;
    if (counter > counterLimit) counter = 0;
    renderParticles();
    strip.show();
    clearPixels();
    delay(frameDuration);
}

void initPattern() {
    counter = 0;
    for (int i=0; i<maxParticles; i++) {
        int pActive = particleParams[i*16];		
        if (pActive == 1) {
            // limit the corona sizes
            int pCoronaLeading = particleParams[i*16+8];
            pCoronaLeading = min(pCoronaLeading, maxLeadingCorona);
            particleParams[i*16+8] = pCoronaLeading;

            int pCoronaTrailing = particleParams[i*16+9];
            pCoronaTrailing = min(pCoronaTrailing, maxTrailingCorona);
            particleParams[i*16+9] = pCoronaTrailing;
        }
    }
}

    Mirf.config();
    Serial.println("CLIENT READY");
    
    pinMode(buttonPin,INPUT_PULLUP);
    
    strip.begin();
    strip.show();
    initPattern();
    // fill the active params arrays with their default values
    memcpy(activeParticleParams, particleParams1, 128);
    memcpy(activeRingParams, ringParams1, 128);
}

void loop() {
