Introduction: Arduino Random Mood Light
Essentially, this device randomly generates a color, then fades to it. More info on the guts in the code section.
You will need:
- Some Jumper wires
- One RGB Led, center cathode, or three red, green, and blue LEDS.
- A 220Ohm resistor
- A solderless breadboard, or just skill with Perfboards/PCB's
- An arduino, or an ATtiny by Atmel (xBacon knows about these)
- Eyes (to look at it)
- Optional: A sheet of paper
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Wire Up the Led
First, stick the LED into the breadboard. Connect ground on the LED, which usually is the longest pin, through the resistor, to the GND pin on the Arduino. The color wires on the LED should be connected to 9, 10, and 11 on the arduino. If you need to use other pins, make sure they have a ~ next to them, or they're PWM. It really doesn't matter which color pins go where, since the 'duino sends random colors to the LED. Usually red is all the way to one side, next to ground. Blue is on the opposite side, and green is in the middle.
Step 2: CodeCodeCodeCodeCodeCode!
Copy and paste the following code into the Arduino IDE, available at arduino.cc
Computerized Waterlubber to Noob translation:
This device generates three random numbers for the brightness of each color: Red, Green, and Blue
Then it fades each color indivdually to get to the new 'overall' color.
Finally it waits a random time before it repeats!
Step 3: The Finished Product!
Hope you enjoyed! Email me: BUTTON GO CLICKY!