   digitalWrite(strobePin, HIGH);
 }
 
-void setColors(int bulbsInSet, int totalLEDs) {
-  switch(bulbsInSet){
-    case 7:
-      seven(totalLEDs);
-      break;
-    case 4:
-      four(totalLEDs);
-      break;
-    case 3:
-      three(totalLEDs);
-      break;
-    case 2:
-      two(totalLEDs);
-      break;
-    default:
-      three(totalLEDs);
-      break;
-  }
-}
-
-void two(int totalLEDs) {
-  for (int i = 0; i < totalLEDs; i++){
-    if (i == 0 || (i % 2) == 0) {
-      /* position 1 on strip - Red */
-      strip.setPixelColor(i, spectrumValue[0], spectrumValue[1], spectrumValue[2]);
-    } else {
-      /* position 2 on strip - Blue */
-      strip.setPixelColor(i, spectrumValue[6], spectrumValue[5], spectrumValue[4]);
-    }
+void marqueeMusic(int totalLEDs, int speedFactor) {
+  if ((iteration % speedFactor) == 0) {
+    marqueeOffset++;
   }
 
-  strip.show();
-}
+  int localOffset = (marqueeOffset % 3);
+  
+  for (int i = 0; i < totalLEDs; i++){
+    //if (i > 2) {
+    if (i == 0 || (i % 3) == 0) {
+      /* position 1 on strip */
+      if (i == 0 && localOffset > 0) {
+        if (localOffset == 1) {
+          // Blue
+          strip.setPixelColor(i, 0, 0, ((spectrumValue[4]+spectrumValue[5]+spectrumValue[6])/3));
+        } else {
+          // Green
+         strip.setPixelColor(i, 0, ((spectrumValue[1]+spectrumValue[3])/2), 0);
+        }
+      }
 
-void three(int totalLEDs) {
-  for (int i = 0; i < totalLEDs; i++){
-    if (i == 0 || (i % 3) == 0) {
-      /* position 1 on strip - Red */
-      strip.setPixelColor(i, spectrumValue[4], spectrumValue[2], spectrumValue[0]);
+      //Red
+      strip.setPixelColor(i + localOffset, ((spectrumValue[0]+spectrumValue[2])/2), 0, 0);
     } else if (i == 1 || (i % 3) == 1) {
-      /* position 2 on strip - Green */
-      strip.setPixelColor(i, spectrumValue[1], spectrumValue[5], spectrumValue[3]);      
+      /* position 2 on strip */
+      if (i == 1 && localOffset > 0) {
+        if (localOffset == 1) {
+          // Red
+          strip.setPixelColor(i, ((spectrumValue[0]+spectrumValue[2])/2), 0, 0);
+        } else {
+          // Blue
+          strip.setPixelColor(i, 0, 0, ((spectrumValue[4]+spectrumValue[5]+spectrumValue[6])/3));
+        }
+      }
+
+      //Green
+      strip.setPixelColor(i + localOffset, 0, ((spectrumValue[1]+spectrumValue[3])/2), 0);
     } else {
-      /* position 3 on strip - Blue */
-      strip.setPixelColor(i, spectrumValue[2], spectrumValue[4], spectrumValue[6]);
-    }
-  }
+      /* position 3 on strip */
+      if (i == 2 && localOffset > 0) {
+        if (localOffset == 1) {
+          // Green
+          strip.setPixelColor(i, 0, ((spectrumValue[1]+spectrumValue[3])/2), 0);
+        } else {
+          // Red
+          strip.setPixelColor(i, ((spectrumValue[0]+spectrumValue[2])/2), 0, 0);
+        }
+      }
 
-  strip.show();
-}
-
-void four(int totalLEDs) {
-  for (int i = 0; i < totalLEDs; i++){
-    if (i == 0 || (i % 3) == 0) {
-      /* position 1 on strip - Red */
-      strip.setPixelColor(i, spectrumValue[1], 0, 0);
-    } else if (i == 1 || (i % 3) == 1) {
-      /* position 2 on strip - Green */
-      strip.setPixelColor(i, 0, ((spectrumValue[2] + spectrumValue[3]) / 2), 0);      
-    } else {
-      /* position 3 on strip - Blue */
-      strip.setPixelColor(i, 0, 0, ((spectrumValue[4] + spectrumValue[5] + spectrumValue[6]) / 3));
-    }
-  }
-
-  strip.show();
-}
-
-void seven(int totalLEDs) {
-  for (int i = 0; i < totalLEDs; i++){
-    if (i == 0 || (i % 7) == 0) {
-      /* position 1 on strip */
-      strip.setPixelColor(i, spectrumValue[0], 0, 0);
-    } else if (i == 1 || (i % 7) == 1) {
-      /* position 2 on strip */
-      strip.setPixelColor(i, 0, spectrumValue[1], 0);
-    } else if (i == 2 || (i % 7) == 2) {
-      /* position 3 on strip */
-      strip.setPixelColor(i, 0, 0, spectrumValue[2]);
-    } else if (i == 3 || (i % 7) == 3) {
-      /* position 4 on strip */
-      strip.setPixelColor(i, spectrumValue[3], 0, 0);
-    } else if (i == 4 || (i % 7) == 4) {
-      /* position 5 on strip */
-      strip.setPixelColor(i, 0, spectrumValue[4], 0);
-    } else if (i == 5 || (i % 7) == 5) {
-      /* position 6 on strip */
-      strip.setPixelColor(i, 0, 0, spectrumValue[5]);
-    } else {
-      /* position 7 on strip */
-      strip.setPixelColor(i, spectrumValue[6], 0, 0);
-    }
-  }
-
-  strip.show();
-}
-
-void threeMarquee(int totalLEDs) {
-  if (iteration == 10) {
-    /* ensure that we only change the offset once every 100 iterations, so that you can see the marquee effect */
-    iteration = 0;
-
-    if (marqueeOffset < totalLEDs) {
-      /* we can only offset the count up to the total number of LEDs we're processing */
-      marqueeOffset++;
-    } else {
-      marqueeOffset = 0;
-    }
-  }
-
-  /* Hello world test */
-
-  for (int i = 0; i < totalLEDs; i++){  
-    int ledPosition = i + marqueeOffset;  
-
-    if (ledPosition > totalLEDs) {
-      ledPosition = ledPosition - totalLEDs;
-    }
-    
-    if (ledPosition == 0 || (ledPosition % 3) == 0) {
-      /* position 1 on strip - Red */
-      strip.setPixelColor(ledPosition, spectrumValue[0], 0, 0);
-    } else if (ledPosition == 1 || (ledPosition % 3) == 1) {
-      /* position 2 on strip - Green */
-      strip.setPixelColor(ledPosition, 0, ((spectrumValue[1]+spectrumValue[2])/2), 0);      
-    } else {
-      /* position 3 on strip - Blue */
-      strip.setPixelColor(ledPosition, 0, 0, ((spectrumValue[3]+spectrumValue[4]+spectrumValue[5]+spectrumValue[6])/4));
+      // Blue
+      strip.setPixelColor(i + localOffset, 0, 0, ((spectrumValue[4]+spectrumValue[5]+spectrumValue[6])/3));
     }
   }
 
   strip.show();
 
   iteration++;
+}
+
+void bouncingRainbow() {
+  if ((color % 7) == 0) {
+    strip.setPixelColor(iteration, 255, 0, 0);
+  } else if ((color % 7) == 1) {
+    strip.setPixelColor(iteration, 255, 127, 0);
+  } else if ((color % 7) == 2) {
+    strip.setPixelColor(iteration, 255, 255, 0);
+  } else if ((color % 7) == 3) {
+    strip.setPixelColor(iteration, 0, 255, 0);
+  } else if ((color % 7) == 4) {
+    strip.setPixelColor(iteration, 0, 0, 255);
+  } else if ((color % 7) == 5) {
+    strip.setPixelColor(iteration, 75, 0, 130);
+  } else {
+    strip.setPixelColor(iteration, 139, 0, 255);
+  }
+
+  if (forward) {
+    strip.setPixelColor(iteration - 1, 0, 0, 0);
+  } else {
+    strip.setPixelColor(iteration + 1, 0, 0, 0);
+  }
+
+  strip.show();
+  
+  if (iteration == 59) {
+    forward = false;
+    color++;
+  } else if (iteration == 0 && color != 7) {
+    forward = true;
+    color++;
+  }
+
+
+  if (forward) {
+    iteration++;
+  } else {
+    iteration--;
+  }
 }
 
 void loop(){  

int strobePin=2;
int resetPin=3;
int spectrumValue[7];
int filter=100;
int iteration = 0;
int marqueeOffset = 0;


void setup(){
  
  //Serial.begin(9600);

  strip.begin();
  strip.show();
  

    spectrumValue[i]=analogRead(analogPin);
    spectrumValue[i]=constrain(spectrumValue[i], filter, 500);
    spectrumValue[i]=map(spectrumValue[i], filter,500,0,255);
    digitalWrite(strobePin, HIGH);
  }

  marqueeMusic(60, 5);
}


