// ====================================================================================================================================================== // ====================================================================================================================================================== // ---------------functions to change and animate the Neopixels ------------------- // ====================================================================================================================================================== // ====================================================================================================================================================== //----------------------------------------------------------------------------------- // -- Turn all neopixels ON at one time using inputted color values ------------------ void pixel_all_ON(int R, int G, int B) { for(int i=0; i=0; i--) { strip.setPixelColor(i, RED, GREEN, BLUE); RED = int(RED * 1.6); } strip.show(); } //---------------------------------------------------------------------------------------------- void pixelSingleColorFadeInOut() { int colorChangeVal = 1; int BLUE = 0; modPotValMap = map(modPotVal, 0, 1023, 500, 10); LCDbacklightColor(0,80,150); LCDwriteLineOne(); LCDlineTwoText = "Fade IN<->OUT"; LCDwriteLineTwo(LCDlineTwoText); for(int i=0; i<256; i++) { for(int i=0; i=0; i--) { for(int i=0; i=0; i--) { strip.setPixelColor(i-5, 255, 0, 0); strip.setPixelColor(i-4, 210, 0, 0); strip.setPixelColor(i-3, 70, 33, 0); strip.setPixelColor(i-2, 10, 5, 0); strip.setPixelColor(i-1, 1, 3, 0); strip.setPixelColor(i, 0, 0, 0); strip.show(); delay(modPotValMap); } } //---------------------------------------------------------------------------------------------- //-------- Scan pixel from 0->23->0 ------------------- void pixelScan() { LCDbacklightColor(200,0,200); LCDwriteLineOne(); LCDlineTwoText = "Cylonic Knights"; //AKA "Larson" LCDwriteLineTwo(LCDlineTwoText); modPotValMap = map(modPotVal, 0, 1023, 500, 10); for(int i=0; i=0; i--) { strip.setPixelColor(i, colorRED, colorGREEN, colorBLUE); strip.show(); delay(modPotValMap); strip.setPixelColor(i, 0, 0, 0); strip.show(); } } //---------------------------------------------------------------------------------------------- //--- Move single "sparkling" pixel around ring ------------------- void pixelChaseSparkle() { LCDbacklightColor(100,100,0); LCDwriteLineOne(); LCDlineTwoText = "Circus SparkleFX"; LCDwriteLineTwo(LCDlineTwoText); modPotValMap = map(modPotVal, 0, 1023, 100, 1); for(int i=0; i=0; i--) { strip.setPixelColor(i, 0, 0, 0); strip.show(); delay(modPotValMap); } delay (modPotValMap); } //---------------------------------------------------------------------------------------------- //--- Add one pixel after another then remove from 0 -- void pixelStackUnstackFrom0() { modPotValMap = map(modPotVal, 0, 1023, 500, 10); LCDbacklightColor(150,0,50); LCDwriteLineOne(); LCDlineTwoText = "Stack Unstack-0"; LCDwriteLineTwo(LCDlineTwoText); for(int i=0; i=0; i--) { strip.setPixelColor(i, RED, GREEN, BLUE); strip.setPixelColor(strip.numPixels()-i, RED, GREEN, BLUE); strip.show(); delay(modPotValMap); RED=0; GREEN=GREEN+40; BLUE=BLUE-40; } BLUE=0; for(int i=0; i<=strip.numPixels()/2; i++) { strip.setPixelColor(i, RED, GREEN, BLUE); strip.setPixelColor(strip.numPixels()-i, RED, GREEN, BLUE); strip.show(); delay(modPotValMap); RED=RED+40; GREEN=GREEN-40; BLUE=0; } } //---------------------------------------------------------------------------------------------- //---------- Fade between two colors ------------------ COOL FX FROM MISTAKE void pixelSplitRainbow__2() { int RED = 240; int GREEN = 0; int BLUE = 0; RED = REDvalOne; GREEN = GREENvalOne; BLUE = BLUEvalOne; int fadeSPEED = map(modPotVal, 0, 1023, 500, 10); for(int i=0; i<=strip.numPixels()/2; i++) { strip.setPixelColor(i, RED, GREEN, BLUE); strip.setPixelColor(strip.numPixels()-i, RED, GREEN, BLUE); strip.show(); delay(fadeSPEED); RED=RED-40; GREEN=0; BLUE=BLUE+40; } RED=0; for(int i=strip.numPixels()/2; i>=0; i--) { strip.setPixelColor(i, RED, GREEN, BLUE); strip.setPixelColor((strip.numPixels()/2)+i, RED, GREEN, BLUE); strip.show(); delay(fadeSPEED); RED=0; GREEN=GREEN+40; BLUE=BLUE-40; } } //---------------------------------------------------------------------------------------------- //---------- Fade in-and-out from black --------------------------------------------- void pixelFadeInOut() { int numIterations = 50; int RED = 0; int GREEN = 0; int BLUE = 0; modPotValMap = map(modPotVal, 0, 1023, 100, 1); LCDbacklightColor(200,0,100); LCDwriteLineOne(); LCDlineTwoText = "Fade In-&-Out"; LCDwriteLineTwo(LCDlineTwoText); for(int x=0; x