Rachel Greider
Published

Simba Hat

This hat is a fun accompaniment to the song, Simba. It includes lights that are programed to fade in and out to the beat of the song.

BeginnerShowcase (no instructions)484
Simba Hat

Things used in this project

Hardware components

ProtoSnap - LilyPad Development Board
SparkFun ProtoSnap - LilyPad Development Board
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Conductive Thread
Hat

Story

Read more

Schematics

Circuit Sketches

Code

Code

Arduino
I used a delay to create each fade in and out. This allowed me to change the timing of the fade throughout the program.
int yellowLED = 6;
int redLED = A8;
int yellowLED2 = A7;
int switchPin = A9;
int switchLED = A5;

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(yellowLED, OUTPUT);
  pinMode(switchPin, INPUT_PULLUP);
  pinMode(switchLED, OUTPUT);
}


void loop() {
  int switchState;

  switchState = digitalRead(switchPin);

  digitalWrite(yellowLED,LOW);
  digitalWrite(yellowLED2,LOW);
  digitalWrite(redLED,LOW);
  digitalWrite(switchLED,LOW);

 
  if (switchState == LOW) 
  {

  int brightness;

for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(30);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }


 for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);} 
    
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }
    
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }



for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(10);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(11); }   



for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);} 
    
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }
    
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }



for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(10);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(11); }  



  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }




  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }


   for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

      for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

    for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);} 
    
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }
    
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }


for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(5);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(5); }   

    
for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(5);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(5); } 

for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(5);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
   analogWrite(redLED, brightness);
    delay(5); } 


for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5); }

   for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5); }

 
for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5); }
 
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
  analogWrite(redLED, brightness);
    delay(5); }
   
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }
    
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

      for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }
    
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED, brightness);
  analogWrite(yellowLED2, brightness);
    delay(5); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }


   for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

      for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

    for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);} 
    
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }
    
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }


   for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

      for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

    for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}

  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);} 
    
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }
    
  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
 
  for (brightness = 255; brightness >= 0; brightness = brightness - 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2); }

  for (brightness = 0; brightness <= 255; brightness = brightness + 1)
  {
  analogWrite(yellowLED2, brightness);
    delay(2);}
...

This file has been truncated, please download it to see its full contents.

Credits

Rachel Greider

Rachel Greider

1 project • 0 followers

Comments