RGB Tutorial

Welcome! Lets find out what we will be learning from this website!

The following tutorial will contain all the necessary step to create an RGB LED project. There will be a image of all required materials, then there will be a step by step process with images followed by the code given in a form that allows you to copy and paste it straight into the coding software. In addition, to insure that all aspects especially the code are being used correctly a short video clip will be provided!

Step 1: Required Materials

Here is an image of the required materials:

*A laptop with the Arduino software is also required.

Step 2: Building Process

Step 1 : Place 3 potentiometers in the center of the breadboard

Step 2 : Take a wire and place it in- front of the forward leg of the potentiometer, then attach the cable to A1

Step 3 and Step 4 : Repeat step 2 for the other two potentiometers by connecting the wire from the leg to A2 and the other from the leg to A3

Step 5 : Place a wire into a negative square and place it into the right leg of the potientometer and then take a another wire and attach it from a positive square to the left leg of the potentiometer.

Step 6 and 7 : Repeat step 5 for the other two potentiometers

Step 8 : Take a wire from a positive square and connect it to port GND

Step 9 : Take a wire from from a negative square and connect it to port 5V

Step 10 : Place the LED under the previously used wires

Step 11 : Connect a wire from port 11 to a square near the edge yet close to the LED

Step 12 and Step 13 : Repeat step 11 using ports 9 and 10

Step 14 : Connect the resistor from the previously used wire to the 1st, 3rd and 4th leg of the LED

Step 15 : Finally, connect a wire from the second leg of the LED across the breadboard to a negative square

Step 3: The Coding

Below is the code that you can copy and past straight into the arduino software...

void setup() {





// put your setup code here, to run once:


void loop() {

// put your main code here, to run repeatedly: analogWrite(9, analogRead(A0)/4);

analogWrite(10, analogRead(A1)/4);

analogWrite(11, analogRead(A2)/4); }

Brief Explanation:

This is a very simple code that can be explained easily through making connections between the short code. It starts of with explaining the 3 OUTPUTS which are 9,10 and 11. This links to the building process as plugging the wires into the ports was one of the last steps. After that 3 similarly structured lines are placed there which basically explain to the Arduino that for each output here is a set port. For example, the first one states that for port 9 to read from A0. This is exactly the same with the other two lines however diffrent outputs and ports and that is the end to the code.

Step 4: Making It Work All Together!

Lets take a look at the final product and how it all works together..




    • Pocket Sized Contest

      Pocket Sized Contest
    • Paper Contest

      Paper Contest
    • Weaving Challenge

      Weaving Challenge