Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on April 11, 2016 at 10:19 AM

Section 1 (Text)

/*
Under Door Lighting Sketch by PerfectPixel, 2016. Code edited from examples on Tweaking4all.com.
Library provided by Adafruit.

Tweaking4all: http://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/
Adafruit: https://www.adafruit.com/
PerfectPixel: http://www.instructables.com/member/perfectpixel

all code is public domain.
*/
#include <Adafruit_NeoPixel.h>
#define PIN 9
#define NUM_LEDS 27

int BUTTON1_A = 11;
int BUTTON1_B = 12;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  pinMode(BUTTON1_A, OUTPUT);
  pinMode(BUTTON1_B, INPUT);

  digitalWrite(BUTTON1_A, HIGH);
  
  strip.begin();
  strip.show();
}

void loop(){
  while(digitalRead(BUTTON1_B) == LOW){ //Effects while the door is open
   switch(random(11)){ //change these effects to suit your preferences!
    case 1:
   CylonBounce(0, 255, 150, 7, 35, 100);
    break;

    case 2:
   rainbowCycle(5);
    break;
    
    case 3:
   RunningLights(0,0,255, 50);
    break;
    
    case 4:
    CylonBounce(255, 100, 0, 7, 35, 100);
    break;
    
    case 5:
   RunningLights(255,0,0, 50);
    break;

    case 6:
   rainbowCycle(2);
    break;

    case 7:
    CylonBounce(100, 100, 100, 3, 35, 100);
    break;

    case 8:
    RunningLights(0,255,0, 50);
    break;

    case 9:
     rainbowCycle(6);
    break;

    case 10:
     rainbowCycle(10);
    break;
   }
  }

   while(digitalRead(BUTTON1_B) == HIGH){ //Effects while the door is closed
    setAll(0,0,0);
  }
}
/* 
 *  
 *  
 *  
 *  
 *  
------------------ */

void CylonBounce(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay){

  for(int i = 0; i < NUM_LEDS-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 = NUM_LEDS-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 rainbowCycle(int SpeedDelay) {
  byte *c;
  uint16_t i, j;

  for(j=0; j<256*2; j++) {
    for(i=0; i< NUM_LEDS; i++) {
      c=Wheel(((i * 256 / NUM_LEDS) + j) & 255);
      setPixel(i, *c, *(c+1), *(c+2));
    }
    showStrip();
    delay(SpeedDelay);
  }
}

byte * Wheel(byte WheelPos) {
  static byte c[3];
  
  if(WheelPos < 85) {
   c[0]=WheelPos * 3;
   c[1]=255 - WheelPos * 3;
   c[2]=0;
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   c[0]=255 - WheelPos * 3;
   c[1]=0;
   c[2]=WheelPos * 3;
  } else {
   WheelPos -= 170;
   c[0]=0;
   c[1]=WheelPos * 3;
   c[2]=255 - WheelPos * 3;
  }

  return c;
}

void RunningLights(byte red, byte green, byte blue, int WaveDelay) {
  int Position=0;
  
  for(int i=0; i<NUM_LEDS*2; i++)
  {
      Position++; // = 0; //Position + Rate;
      for(int i=0; i<NUM_LEDS; i++) {
        // sine wave, 3 offset waves make a rainbow!
        //float level = sin(i+Position) * 127 + 128;
        //setPixel(i,level,0,0);
        //float level = sin(i+Position) * 127 + 128;
        setPixel(i,((sin(i+Position) * 127 + 128)/255)*red,
                   ((sin(i+Position) * 127 + 128)/255)*green,
                   ((sin(i+Position) * 127 + 128)/255)*blue);
      }
      
      showStrip();
      delay(WaveDelay);
  }
}

/* ---------------------
 *  
 *  
 *  
 *  
 */
void showStrip() {
   strip.show();
}

void setPixel(int Pixel, byte red, byte green, byte blue) {
   strip.setPixelColor(Pixel, strip.Color(red, green, blue));
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue); 
  }
  showStrip();
}