Glow-in-the-dark Frisbee
Everyone loves glow-in-the-dark.
Everyone loves glow-in-the-dark.
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.
This allows the microcontroller to control the LEDs.
This is basically a small computer on a single chip. This chip will control the LEDs.
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.
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
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 | LEDs on | ||
---|---|---|---|
Red | Red | ||
Yellow | Red | Green | |
Green | Green | ||
Cyan | Green | Blue | |
Blue | Blue | ||
Magenta | Red | Blue | |
White | Red | Green | Blue |
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); }
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 programming help can be found at energia.nu/guide
Additional download options can be found at energia.nu/download
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.
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.
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.
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.
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.
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.
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. |