Two External LEDs Experiments

After completing the Two External LEDs project, test yourself by trying these experiments.

1 Modify the code to turn on one LED at a time. The net effect is that you'll see the two LEDs flash back and forth. Two External LEDs
2 Connect five external LEDs.

Modify the code to controll these five LEDs by turning all of them on for 1 second and then all of them off for another second.
Five External LEDs
3 Modify the code for the five LEDs so that only one LED is turned on at any one time. The five LEDs will turn on in sequence.
int blue_led = 2;   // the blue led is connected to pin 2
int green_led = 3;  // the green led is connected to pin 3
int yellow_led = 4; // the yellow led is connected to pin 4
int red_led = 5;    // the red led is connected to pin 5
int white_led = 6;  // the white led is connected to pin 6

void setup() {
  pinMode(blue_led, OUTPUT);
  pinMode(green_led, OUTPUT);
  pinMode(yellow_led, OUTPUT);
  pinMode(red_led, OUTPUT);
  pinMode(white_led, OUTPUT);
}

void loop() {
  digitalWrite(blue_led, HIGH);   // turn on the blue led
  digitalWrite(green_led, LOW);   // turn off the green led
  digitalWrite(yellow_led, LOW);  // turn off the yellow led
  digitalWrite(red_led, LOW);     // turn off the red led
  digitalWrite(white_led, LOW);   // turn off the white led
  delay(1000);

  digitalWrite(blue_led, LOW);    // turn off the blue led
  digitalWrite(green_led, HIGH);  // turn on the green led
  digitalWrite(yellow_led, LOW);  // turn off the yellow led
  digitalWrite(red_led, LOW);     // turn off the red led
  digitalWrite(white_led, LOW);   // turn off the white led
  delay(1000);

  digitalWrite(blue_led, LOW);    // turn off the blue led
  digitalWrite(green_led, LOW);   // turn off the green led
  digitalWrite(yellow_led, HIGH); // turn on the yellow led
  digitalWrite(red_led, LOW);     // turn off the red led
  digitalWrite(white_led, LOW);   // turn off the white led
  delay(1000);

  digitalWrite(blue_led, LOW);    // turn off the blue led
  digitalWrite(green_led, LOW);   // turn off the green led
  digitalWrite(yellow_led, LOW);  // turn off the yellow led
  digitalWrite(red_led, HIGH);    // turn on the red led
  digitalWrite(white_led, LOW);   // turn off the white led
  delay(1000);

  digitalWrite(blue_led, LOW);    // turn off the blue led
  digitalWrite(green_led, LOW);   // turn off the green led
  digitalWrite(yellow_led, LOW);  // turn off the yellow led
  digitalWrite(red_led, LOW);     // turn off the red led
  digitalWrite(white_led, HIGH);  // turn on the white led
  delay(1000);
}
4 Be creative and make some interesting light show.
5 Add some music to your light show! First make it play the Star Wars song (or another song you like) and then display your light show.
6 Instead of displaying your light show AFTER playing the song, make it play the song and flash the lights at the SAME TIME. Hint, you'll need to interleave the code for the song and the lights.