RedBlueGreen All in One RGB LED: Project 3

Goal: Learning how to wire and code an RGB LED with the intent to incorporate it into a bigger project

Using Pulse Width Modulation (PWM) to mimic analog results

Materials:
1 RGB LED
3 330 ohm resistors
6 jumper wires


Procedure:
1. Assemble the circuit
I altered the jumper wires to colors that made sense to me.

Arduino pins used
RGB LED: a4 red
                   a5 GND (longest lead)
                   a6 green
                   a7 blue
Resistors:   e4 to g4
                  e6 to g6
                  e7 to g7
Jumper small black: e5 to "-"
Jumper large black: "-" to GND on Arduino
Jumper white: h4 to Pin 9 on Arduino
                        (red is used for power)
Jumper green: h6 to Pin 10 on Arduino
Jumper blue: h7 to Pin 11 on Arduino
Jumper red: "+" to 5V on Arduino



Notice the jumper from the left side of the breadboard to the right using the resistors.  Follow the electron flow to see why the GND and 5V on the Arduino is connected to the "+" and "_" on the left side of the breadboard.

Bonus: Can you find my error in the pictured circuit?  Hint: the program ran and the LED lit up, but not as expected.





2. Write the code
I retype the downloaded code files to get a better understanding of how to use the code independent of this project.  Below are screenshots of the basics.  I didn't include all the color combinations within the mainColors() function.  Play around with combinations and see the "12 Circuit USK Guide Codes" for a complete list.

Part 1: setup and mainColors()
Part 2: showSpectrum() and showRGB()







































Download the "12 Circuit USK Guide Codes" for a details description of each line of code


3. Upload and test it all




Reflection




So far, my journal has been more of a records book.  I've
been rewriting the specifics of each project from the instruction book included in the kit.  I don't feel it's a futile use of time.  Each exercise brings me closer to understanding.  I'm confident that going through the motions will lead to independent thinking which will spark some creativity in creating an original project.

Comments

Popular posts from this blog

Multiple LEDs: Project 4