// TITLE: LEDKeypad12Loops #include #include #include #include #include // These are fixed variables #define Pixel_Count 26 // define number of LEDs in string CRGB leds[Pixel_Count]; CRGBArray led; #define PIXEL_PIN 6 // Arduino data pin 6 out Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixel_Count, PIXEL_PIN, NEO_GRB + NEO_KHZ800); const byte ROWS = 4; // four rows R0=Pin2, R1=Pin3, R2=Pin4, R4=Pin5 const byte COLS = 3; // three columns C0=Pin7, C1=Pin8, Col2=Pin9 char keys[ROWS][COLS] = { {'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}, {'*', '0', '#'} }; byte rowPins[ROWS] = {2, 3, 4, 5}; // connect to the row pinouts of the keypad byte colPins[COLS] = {7, 8, 9}; // connect to the column pinouts of the keypad int count = 0; // Create keypad Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup() { FastLED.addLeds(leds, Pixel_Count).setCorrection( TypicalLEDStrip ); FastLED.addLeds(led, Pixel_Count); pinMode(PIXEL_PIN, OUTPUT); strip.begin(); strip.show(); // Initialize all pixels to 'off' } // either or code void showStrip() { #ifdef ADAFRUIT_NEOPIXEL_H // NeoPixel strip.show(); #endif #ifndef ADAFRUIT_NEOPIXEL_H // FastLED FastLED.show(); #endif } void setPixel(int Pixel, byte red, byte green, byte blue) { #ifdef ADAFRUIT_NEOPIXEL_H // NeoPixel strip.setPixelColor(Pixel, strip.Color(red, green, blue)); #endif #ifndef ADAFRUIT_NEOPIXEL_H // FastLED leds[Pixel].r = red; leds[Pixel].g = green; leds[Pixel].b = blue; #endif } void setAll(byte red, byte green, byte blue) { for (int i = 0; i < Pixel_Count; i++ ) { setPixel(i, red, green, blue); } showStrip(); } void FadeInOut(byte red, byte green, byte blue) { float r, g, b; for (int k = 0; k < 256; k = k + 1) { r = (k / 256.0) * red; g = (k / 256.0) * green; b = (k / 256.0) * blue; setAll(r, g, b); showStrip(); } for (int k = 255; k >= 0; k = k - 2) { r = (k / 256.0) * red; g = (k / 256.0) * green; b = (k / 256.0) * blue; setAll(r, g, b); showStrip(); } } void CylonBounce(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { for (int i = 0; i < Pixel_Count - EyeSize - 2; i++) { setAll(0, 0, 0); setPixel(i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(i + j, red, green, blue); } setPixel(i + EyeSize + 1, red / 10, green / 10, blue / 10); showStrip(); delay(SpeedDelay); } delay(ReturnDelay); for (int i = Pixel_Count - EyeSize - 2; i > 0; i--) { setAll(0, 0, 0); setPixel(i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(i + j, red, green, blue); } setPixel(i + EyeSize + 1, red / 10, green / 10, blue / 10); showStrip(); delay(SpeedDelay); } delay(ReturnDelay); } void loop() { char key = keypad.getKey(); if (key) // Check for a valid key { switch (key) { default: // Turns all LEDS to black colorWipe(strip.Color(0, 0, 0), 50); break; case '1': // First LED loop colorWipe(strip.Color(64, 0, 0), 125); // Red 125 is milliseconds per LED for move colorWipe(strip.Color(64, 64, 0), 125); // Red Green colorWipe(strip.Color(0, 64, 0), 125); // Green colorWipe(strip.Color(0, 64, 64), 125); // Green Blue colorWipe(strip.Color(0, 0, 64), 125); // Blue colorWipe(strip.Color(64, 0, 64), 125); // Blue Red colorWipe(strip.Color(0, 0, 64), 125); // Blue colorWipe(strip.Color(0, 64, 64), 125); // Green Blue colorWipe(strip.Color(0, 64, 0), 125); // Green colorWipe(strip.Color(64, 64, 0), 125); // Green Red colorWipe(strip.Color(64, 0, 0), 125); // Red colorWipe(strip.Color(0, 0, 0), 25); // Black/off break; case '2': colorWipe(strip.Color(64, 0, 0), 225); // Red 225 is milliseconds per LED for move colorWipe(strip.Color(64, 64, 64), 225); // White colorWipe(strip.Color(0, 0, 64), 225); // Blue colorWipe(strip.Color(64, 0, 0), 225); // Red colorWipe(strip.Color(64, 64, 64), 225); // White colorWipe(strip.Color(0, 0, 64), 225); // Blue colorWipe(strip.Color(0, 0, 0), 25); // Black/off break; case '3': colorWipe(strip.Color(64, 0, 0), 55); // Red as above colorWipe(strip.Color(64, 64, 0), 55); // Red Green colorWipe(strip.Color(0, 64, 0), 55); // Green colorWipe(strip.Color(0, 64, 64), 55); // Green Blue colorWipe(strip.Color(0, 0, 64), 55); // Blue colorWipe(strip.Color(64, 0, 64), 55); // Blue Red colorWipe(strip.Color(0, 0, 64), 55); // Blue colorWipe(strip.Color(0, 64, 64), 55); // Blue Green colorWipe(strip.Color(0, 64, 0), 55); // Green colorWipe(strip.Color(64, 64, 0), 55); // Green Red colorWipe(strip.Color(64, 0, 0), 55); // Red colorWipe(strip.Color(64, 64, 64), 110); // White colorWipe(strip.Color(64, 0, 0), 55); // Red colorWipe(strip.Color(64, 64, 0), 55); // Red Green colorWipe(strip.Color(0, 64, 0), 55); // Green colorWipe(strip.Color(0, 64, 64), 55); // Green Blue colorWipe(strip.Color(0, 0, 64), 55); // Blue colorWipe(strip.Color(64, 0, 64), 55); // Blue Red colorWipe(strip.Color(0, 0, 64), 55); // Blue colorWipe(strip.Color(0, 64, 64), 55); // Green Blue colorWipe(strip.Color(0, 64, 0), 55); // Green colorWipe(strip.Color(64, 64, 0), 55); // Green Red colorWipe(strip.Color(64, 0, 0), 55); // Red colorWipe(strip.Color(0, 0, 0), 25); // Black/off break; case '4': rainbowCycle(10); // delay(5000); colorWipe(strip.Color(50, 50, 50), 100); // white delay(250); colorWipe(strip.Color(100, 0, 0), 150); // red delay(250); colorWipe(strip.Color(100, 0, 100), 100); // red-blue delay(250); colorWipe(strip.Color(0, 0, 100), 150); // blue delay(250); colorWipe(strip.Color(50, 50, 50), 100); // white delay(1500); colorWipe(strip.Color(50, 100, 50), 100); // white-green delay(500); colorWipe(strip.Color(0, 100, 0), 150); // green delay(500); colorWipe(strip.Color(0, 100, 100), 100); // green-blue delay(350); colorWipe(strip.Color(0, 0, 100), 100); // blue delay(350); colorWipe(strip.Color(100, 0, 100), 100); // blue-red delay(350); colorWipe(strip.Color(100, 0, 0), 150); // red delay(1000); colorWipe(strip.Color(50, 50, 50), 100); // white delay(500); colorWipe(strip.Color(0, 0, 0), 100); // black delay(750); break; case '5': rainbow(130); // 20 increased to 130 to extend time colorWipe(strip.Color(0, 0, 0), 15); // Black/off break; case '6': rainbowCycle(30); // 20 increased to 30 to extend time colorWipe(strip.Color(0, 0, 0), 15); // Black/off break; case '7': theaterChaseRainbow(42); // 50 dropped to 42 to shorten time colorWipe(strip.Color(0, 0, 0), 15); // Black/off break; case '8': // Send a theater pixel chase in... theaterChase(strip.Color(64, 64, 64), 500); // White theaterChase(strip.Color(64, 0, 0), 500); // Red theaterChase(strip.Color(64, 64, 0), 500); // Red Green theaterChase(strip.Color( 0, 64, 0), 500); // Green theaterChase(strip.Color( 0, 64, 64), 500); // Green Blue theaterChase(strip.Color( 0, 0, 64), 500); // Blue theaterChase(strip.Color( 64, 0, 64), 500); // Blue Red colorWipe(strip.Color(0, 0, 0), 15); // Black/off break; case '9': rainbow(15); theaterChaseRainbow(45); rainbowCycle(10); colorWipe(strip.Color(0, 0, 0), 15); // Black/off break; case '*': TwinkleRandom(325, 100, false); colorWipe(strip.Color(0, 0, 0), 15); // Black/off break; case '0': NewKITT(random(0, 64), random(0, 64), random(0, 64), 5, 50, 150); NewKITT(random(0, 64), random(0, 64), random(0, 64), 5, 50, 150); NewKITT(random(0, 64), random(0, 64), random(0, 64), 5, 50, 150); NewKITT(random(0, 64), random(0, 64), random(0, 64), 5, 50, 150); NewKITT(random(0, 64), random(0, 64), random(0, 64), 5, 50, 150); colorWipe(strip.Color(0, 0, 0), 50); break; case '#': HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); HalloweenEyes(random(5, 125), random(5, 125), random(5, 125), random(2, 5), random(2, 10), true, random(5, 50), random(10, 50), random(10, 50)); } } } // Fill the dots one after the other with a color void colorWipe(uint32_t c, uint8_t wait) { for (uint16_t i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, c); strip.show(); delay(wait); } } void rainbow(uint8_t wait) { uint16_t i, j; for (j = 0; j < 256; j++) { for (i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, Wheel((i + j) & 255)); } strip.show(); delay(wait); } } // Slightly different, this makes the rainbow equally distributed throughout void rainbowCycle(uint8_t wait) { uint16_t i, j; for (j = 0; j < 256 * 4; j++) { // 5 cycles of all colors on wheel, changed to 4 for length for (i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255)); } strip.show(); delay(wait); } } //Theatre-style crawling lights void theaterChase(uint32_t c, uint8_t wait) { for (int j = 0; j < 15; j++) { //do 10 cycles of chasing, changed back to 10 for code error 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 < 256; j++) { // cycle all 256 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) % 255)); //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 } } } } // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { WheelPos = 255 - WheelPos; if (WheelPos < 85) { return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } if (WheelPos < 170) { WheelPos -= 85; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } WheelPos -= 170; return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } // Twinkle code from here south, I added Feb. 2 void TwinkleRandom(int Count, int SpeedDelay, boolean OnlyOne) { setAll(0, 0, 0); for (int i = 0; i < Count; i++) { setPixel(random(Pixel_Count), random(0, 255), random(0, 255), random(0, 255)); showStrip(); delay(SpeedDelay); if (OnlyOne) { setAll(0, 0, 0); } } delay(SpeedDelay); } // NewKittColor code from here south, I added Feb. 2 void NewKITT(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { RightToLeft(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); LeftToRight(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); OutsideToCenter(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); CenterToOutside(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); LeftToRight(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); RightToLeft(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); OutsideToCenter(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); CenterToOutside(red, green, blue, EyeSize, SpeedDelay, ReturnDelay); } void CenterToOutside(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { for (int i = ((Pixel_Count - EyeSize) / 2); i >= 0; i--) { setAll(0, 0, 0); setPixel(i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(i + j, red, green, blue); } setPixel(i + EyeSize + 1, red / 10, green / 10, blue / 10); setPixel(Pixel_Count - i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(Pixel_Count - i - j, red, green, blue); } setPixel(Pixel_Count - i - EyeSize - 1, red / 10, green / 10, blue / 10); showStrip(); delay(SpeedDelay); } delay(ReturnDelay); } void OutsideToCenter(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { for (int i = 0; i <= ((Pixel_Count - EyeSize) / 2); i++) { setAll(0, 0, 0); setPixel(i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(i + j, red, green, blue); } setPixel(i + EyeSize + 1, red / 10, green / 10, blue / 10); setPixel(Pixel_Count - i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(Pixel_Count - i - j, red, green, blue); } setPixel(Pixel_Count - i - EyeSize - 1, red / 10, green / 10, blue / 10); showStrip(); delay(SpeedDelay); } delay(ReturnDelay); } void LeftToRight(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { for (int i = 0; i < Pixel_Count - EyeSize - 2; i++) { setAll(0, 0, 0); setPixel(i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(i + j, red, green, blue); } setPixel(i + EyeSize + 1, red / 10, green / 10, blue / 10); showStrip(); delay(SpeedDelay); } delay(ReturnDelay); } void RightToLeft(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { for (int i = Pixel_Count - EyeSize - 2; i > 0; i--) { setAll(0, 0, 0); setPixel(i, red / 10, green / 10, blue / 10); for (int j = 1; j <= EyeSize; j++) { setPixel(i + j, red, green, blue); } setPixel(i + EyeSize + 1, red / 10, green / 10, blue / 10); showStrip(); delay(SpeedDelay); } delay(ReturnDelay); } // Pulsating eyes random color here south, I added Feb. 2 // Fixed: // HalloweenEyes(0xff, 0x00, 0x00, 1,4, true, 10, 80, 3000); 2 RED eyes (1,4) with a spacing of 4 // or Random: everything but number of LED's (1,2) (left & right eyes) and spacing between eyes // Shade of red, shade of green, shade of blue, eye width, eye spacing, fade time, step time, fade delay time, end pause time. void HalloweenEyes(byte red, byte green, byte blue, int EyeWidth, int EyeSpace, boolean Fade, int Steps, int FadeDelay, int EndPause) { randomSeed(analogRead(0)); int i; int StartPoint = random( 0, Pixel_Count - (2 * EyeWidth) - EyeSpace ); int Start2ndEye = StartPoint + EyeWidth + EyeSpace; for (i = 0; i < EyeWidth; i++) { setPixel(StartPoint + i, red, green, blue); setPixel(Start2ndEye + i, red, green, blue); } showStrip(); if (Fade == true) { float r, g, b; for (int j = Steps; j >= 0; j--) { r = j * (red / Steps); g = j * (green / Steps); b = j * (blue / Steps); for (i = 0; i < EyeWidth; i++) { setPixel(StartPoint + i, r, g, b); setPixel(Start2ndEye + i, r, g, b); } showStrip(); delay(FadeDelay); } } setAll(0, 0, 0); // Set all black delay(EndPause); }