Components of your LED Frisbee

Your Frisbee is already assembled. These are the components that went into making it, as well as the tools you will use to program it:

Icon

Glow-in-the-dark Frisbee

Everyone loves glow-in-the-dark.

Icon

RGB LEDs

Your Frisbee has 5 RGB LEDs. Each Light Emiting Diode can glow Red, Green, and Blue. By combining these 3 colors in different ways, you can create almost any color.

Icon

Premade Circuit Board

This allows the microcontroller to control the LEDs.

Texas Instruments Microcontroller (TI_PDIP_20)

Microcontroller

This is basically a small computer on a single chip. This chip will control the LEDs.

Icon

MSP430 Board

This board does not attach to the frisbee. You will use a USB cable to connect this board to your computer and use it to program your microcontroller.

MSP430 Board Layout

You will use this board to program your microcontroller. The board will attach to your computer using a micro USB cable. After you have programmed the microcontroller, you will remove it from the board and put it into your Frisbee.

Board Layout

Pin to LED assignments:

You can choose to re-label the LEDs in any way you want, but this lets you know the pin location of each LED.

RED5 = 12
GREEN5 = 11
BLUE5 = 13

RED4 = 9
GREEN4 = 8
BLUE4 = 10

RED1 = 15
GREEN1 = 14
BLUE1 = 19

RED2 = 3
GREEN2 = 2
BLUE2 = 4

RED3 = 6
GREEN3 = 5
BLUE3 = 7

Board Layout

Programming Help

Download Energia

If you are working at home and haven't already downloaded the programming software Energia, follow the intructions at the bottom of the page.

Instructions

1. Open a new Energia window. You can do this by double clicking on the energia.exe application.

New Energia Window

2. Copy the example code from below and paste it into the eneria window.

Example Code in Energia Window

3. Read the Basic Commands and the Color Mixing sections below so you understand what the commands mean and how they work.

4. Change the code so it does what you want it to.

5. Once you have mastered that, you can learn more in the More Programming Concepts section.

Basic Commands

Command Explanation
int RED1=15; Assigns the name RED1 to the value 15,
allowing you to turn the innermost red LED on by name rather than trying to remember the pin #.
From this point, any time you type “RED1” the program will interpret it as the value “15,” or pin #15.
pinMode(name, OUTPUT); Sets the LED as an output. Put this in the setup code.
digitalWrite(name, HIGH); Turns the LED off.
delay(time); Causes a delay for the given number of milliseconds.

Color Mixing

Color Mixing

The following colors can be achieved by turning on different LEDs (of the same number) at the same time:

Color LEDs on
Red Red
Yellow Red Green
Green Green
Cyan Green Blue
Blue Blue
Magenta Red Blue
White Red Green Blue

Example Code

Note that the code above simply turns on the LEDs 1-5 to different colors and doesn’t change, but all of the needed commands are shown.

You can copy and paste this code into energia, and then change it so it does what you want it to.

More Programming Concepts

For Loops

Allow you to repeat code several times without typing it out every time.

For Loop

The following code would cause three LEDs to blink 10 times.

for(int i=0; i < 10; i++){
  digitalWrite(LED1,HIGH);
  digitalWrite(LED2,HIGH);
  digitalWrite(LED3,HIGH);
  delay(50);
  digitalWrite(LED1,LOW);
  digitalWrite(LED2,LOW);
  digitalWrite(LED3,LOW);
  delay(50);
}

Pulse Width Modulation

The command digitalWrite turns an LED either on or off. On some of the pins, you can use the command analogWrite to vary the brightness of the LED. This allows for additional colors such as orange (which is achieved by turning Red all the way on and Green halfway on). The command is used as follows:

analogWrite(GREEN1, 127);    Note that GREEN1 can be replaced with the name of any LED.

Values can be given between 0 and 255, with 0 being all the way on, 255 being all the way off, and 127 being in the middle. For example, a “for” loop could be used to slowly increase or decrease the brightness of an LED.

Only pins 4, 9, 10, 12, 13, 14, and 19 will respond correctly. The command will run for other pins, but they will either stay off (they might blink a little) or turn all the way on instead of turning on to the desired brightness.

Additional Help

Additional programming help can be found at energia.nu/guide

Additional download options can be found at energia.nu/download

Caring For Your Frisbee

The LED Frisbee design has been carefully tested to ensure durability. However, they are not indestructible. The Frisbee should be fine for normal use, and should even be able to survive small amounts of water, but it is recommended that it be used with care, and not used in the rain or near large amounts of water.

Replacing the battery

The battery is attached with zip ties to ensure that it won’t fall out during a hard impact. Get your parents to help you clip the zip ties. If you want, you can pull out the zip ties and insert new ones, or a piece of sturdy tape, such as duct tape, will hold the new battery in place.

In case the board falls off:

The boards have been attached with industrial strength adhesive that should withstand normal use. In the unlikely event that the LED board becomes detached from the Frisbee, using strong tape, such as duct tape, should reattach the board well enough for normal use.

Removing the Chip

To remove the chip, carefully lift it slowly by putting equal pressure on both sides. Failure to do so can result in bending or breaking the legs of the chip. Also be cautious when inserting the chip into the Frisbee board. Being over forceful or careless can damage the socket, which could result in bad electrical connections and cause some of the lights to remain off.

Replacing the Chip

The pins on the chip are quite fragile, and unless you are extremely careful with them, they could break. If your chips break, you can buy replacements online. We got the chips here.

In case not all of the colors work

Some of the LEDs on your Frisbee might not work for every color, or may stop working eventually. If this is the case with your Frisbee, it is your job as an engineer to program a pattern that still looks cool without using that color.

Glossary

int Short for integer (a number). It is used in a program to assign a variable, which can be used to give a number value (in this case a pin number) a name that is easy to remember. If this is done at the beginning of the program, any time that name is used, the program will interpret it as the number.
Variable A name or symbol that is assigned to a value, such as using int RED1 = 15; to assign the value of 15 to the name RED1.
LED Short for light emitting diode. A small, bright light that requires little power to turn on.
RGB Short for red, green, and blue. Since these are the primary colors of light, they can be combined to make any color.
Pin The chip for the microcontroller has several pins. Writing programs in energia allows you to control whether or not electricity flows through one of the pins. In the case of the Frisbee, this allows you to decide which LEDs are turned on.
Loop A part of a program that repeats continually.
“for” loop A loop that continues until the conditions set for the loop are completed
Pulse width modulation The process of turning on and off an LED quickly such that it appears to be dimmer or brighter. This is done using the command analogWrite for certain pins.
Programming Language Computers only really only understand 1’s and 0’s. However, to make things easier for people, programming languages have been created, which the computer then compiles down to 1’s and 0’s. This way, both people and the computer can understand what is happening. A programming language generally consists of specific, simple commands, which can be combined to do many things. The programming language for energia is specifically made to make programming simple for the MSP430 Launchpad.
Energia A simple programming language specifically for the MSP430 Launchpad.
Algorithm Computers are very useful and fast, but they aren’t very smart. They can only accept specific, simple commands. A list of simple commands that can be used to accomplish a task is called an algorithm.
Electrical Engineer A cool person that gets paid a lot of money to do awesome stuff.

Energia Installation Instructions

1. Go to energia.nu/download

2. Click on the option that fits your computer. The link for windows is highlighted below. Expect it to take around 10 minutes to download.

Download Energia Screenshot

3. Go to your downloads folder. Look for Energia and click on it.

Energia Folder

4. Open the next energia folder.

Next Energia Folder

5. Double-click the energia.exe application.

energia.exe icon

6. Click “Extract All.” You may have to wait for a few minutes for the extraction to complete.

Extract All Screenshot

7. The energia.exe application in your “downloads” folder should now work. Double click on it and a new energia window should pop up. See the programming help section for instructions on how to begin programming your frisbee using energia.