diff --git a/examples/strandtest/strandtest.pde b/examples/strandtest/strandtest.ino old mode 100755 new mode 100644 similarity index 74% rename from examples/strandtest/strandtest.pde rename to examples/strandtest/strandtest.ino index e7c903e..f37a7a9 --- a/examples/strandtest/strandtest.pde +++ b/examples/strandtest/strandtest.ino @@ -45,6 +45,15 @@ void loop() { colorChase(strip.Color( 0, 0, 127), 50); // Blue colorChase(strip.Color(127, 0, 127), 50); // Violet + // Send a theater pixel chase in... + theaterChase(strip.Color(127, 127, 127), 50); // White + theaterChase(strip.Color(127, 0, 0), 50); // Red + theaterChase(strip.Color(127, 127, 0), 50); // Yellow + theaterChase(strip.Color( 0, 127, 0), 50); // Green + theaterChase(strip.Color( 0, 127, 127), 50); // Cyan + theaterChase(strip.Color( 0, 0, 127), 50); // Blue + theaterChase(strip.Color(127, 0, 127), 50); // Violet + // Fill the entire strip with... colorWipe(strip.Color(127, 0, 0), 50); // Red colorWipe(strip.Color( 0, 127, 0), 50); // Green @@ -52,6 +61,7 @@ void loop() { rainbow(10); rainbowCycle(0); // make it go through the cycle fairly fast + theaterChaseRainbow(50); } void rainbow(uint8_t wait) { @@ -113,6 +123,41 @@ void colorChase(uint32_t c, uint8_t wait) { strip.show(); // Refresh to turn off last pixel } +//Theatre-style crawling lights. +void theaterChase(uint32_t c, uint8_t wait) { + for (int j=0; j<10; j++) { //do 10 cycles of chasing + for (int q=0; q < 3; q++) { + for (int i=0; i < strip.numPixels(); i=i+3) { + strip.setPixelColor(i+q, c); //turn every third pixel on + } + strip.show(); + + delay(wait); + + for (int i=0; i < strip.numPixels(); i=i+3) { + strip.setPixelColor(i+q, 0); //turn every third pixel off + } + } + } +} + +//Theatre-style crawling lights with rainbow effect +void theaterChaseRainbow(uint8_t wait) { + for (int j=0; j < 384; j++) { // cycle all 384 colors in the wheel + for (int q=0; q < 3; q++) { + for (int i=0; i < strip.numPixels(); i=i+3) { + strip.setPixelColor(i+q, Wheel( (i+j) % 384)); //turn every third pixel on + } + strip.show(); + + delay(wait); + + for (int i=0; i < strip.numPixels(); i=i+3) { + strip.setPixelColor(i+q, 0); //turn every third pixel off + } + } + } +} /* Helper functions */ //Input a value 0 to 384 to get a color value.