Glow-in-the-dark Frisbee

Everyone loves glow-in-the-dark.

RGB LEDs

Your Frisbee has 6 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.

This allows the microcontroller to control the LEDs.

Microcontroller

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

Micro USB Connector

This connector is on the frisbee board. You will use an USB cable to connect this board to your computer and use it to program your microcontroller.

MSP430 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.

RED1 = 20
GREEN1 = 21
BLUE1 = 19

RED2 = 17
GREEN2 = 18
BLUE2 = 16

RED3 = 3
GREEN3 = 4
BLUE3 = 2

RED4 = 6
GREEN4 = 8
BLUE4 = 5

RED5 = 10
GREEN5 = 11
BLUE5 = 9

RED6 = 13
GREEN6 = 14
BLUE6 = 12

Programming Help

Basic Commands

Command Explanation
int RED1=17; Assigns the name RED1 to the value 17,
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 “17,” or pin #17.
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

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

More Programming Concepts

For Loops

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);
}```

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

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.

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.

In case of the chip not programming

First, make sure that you have downloaded the BYU version of Energia. This version has been specially modified to work with your frisbee board. Next, check to make sure that you are connecting to the correct device within energia. If these are not your problems then unfortunately, electronics cannot be made to last forever. A microcontroller such as the MSP430 will eventually fail overtime and use. If this happens, there isn't much you can do, but you still have a great glow-in-the-dark frisbee! Note: It should only fail after A LOT of use. This most likely won't happen to you.

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 a loop or a delay. 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.