Flora LED

The Capitol Records Building, or the Capitol Records Tower, is a thirteen-story tower located in Los Angeles.  There is a blinking light located at the top of the tower that spells out the word “Hollywood” in Morse code.

capitol records nightHere is the code that I used:

#define ONCE (1000) //1 second
#define LED (9) //LED output

//turn light on
void on() {
digitalWrite(LED, HIGH);
}

//turn light off
void off() {
digitalWrite(LED, LOW);
}

//short mark, dot
void dot() {
on();
delay(ONCE);
}

//longer mark, dash
void dash () {
on();
delay(ONCE*3);
}

//short gap b/w combos
void nextElement() {
off();
delay(ONCE);
}

//short gap (letters)
void nextLetter() {
off();
delay(ONCE*3);
}

//medium gap (words)
void nextWord() {
off();
delay(ONCE*7);
}

void setup() {
pinMode(LED, OUTPUT);
}

void loop() {
//H
dot();
nextElement();
dot();
nextElement();
dot();
nextElement();
dot();

nextLetter ();

//O
dash ();
nextElement();
dash();
nextElement();
dash();

nextLetter ();

//L
dot();
nextElement();
dot();
nextElement();
dash();
nextElement();
dot();

nextLetter();

//L
dot();
nextElement();
dot();
nextElement();
dash();
nextElement();
dot();

nextLetter();

//Y
dash();
nextElement();
dash();
nextElement();
dot();
nextElement();
dash();

nextLetter();

//W
dash();
nextElement();
dash();
nextElement();
dot();

nextLetter();

//O
dash();
nextElement();
dash();
nextElement();
dash();

nextLetter();

//O
dash();
nextElement();
dash();
nextElement();
dash();

nextLetter();

//D
dot();
nextElement();
dot();
nextElement();
dash();

nextWord();
}

Here’s my really lame video: https://drive.google.com/a/artic.edu/file/d/0B9AQV1fJdXlHYTJobktOeC1QNms/view

Advertisements

2 thoughts on “Flora LED

  1. Hello Jackie,

    Great idea with the blinking Hollywood sign. Which pin are you using for your breadboard LED? The code above will blink the onboard LED, but you’d need to change the #define LED (7) line to whichever pin you are using for your LED. You probably also need to define that pin as an output pin in setup.
    void setup () {
    pinMode (9, OUTPUT); // or whichever pin you are using…
    }
    Let me know if you are still having trouble!

    Like

    1. Hi Christine,

      I did try setting pin 9 as the output and the Arduino software keeps displaying an error message that states: “Couldn’t find a Board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board’s reset button after initiating the upload.” The only time that I don’t receive an error message is when I set the output to pin 7, the onboard LED.

      I also received this error message in class. I wonder if it has anything to do with the software that I downloaded; my Arduino program initially had difficulty recognizing the Flora.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s