The Best DIY STEM Tutorials and Projects

RGB Colour Codes

OVERVIEW

Dive into the world of colors with the RGB LED Color Codes project! By mixing red, green, and blue light, we can create endless colors using code. It’s like having a tiny rainbow at your fingertips! 🌈✨

You can follow this video and the instructions below.

Video

Components Required

Here is a list of Components that we will need to make this Project.

Electronic-Dice_Componnets.
Sr #Item NameQuantity
1Arduino Uno1
2Breadboard1
3Resistors3
4Male to Male Jumper Wire4
5Arduino cable1
6RGB LED1

Wiring Diagram

Here is a Complete Wiring Diagram along with Instructions for this Project

Electronic-Dice_Circuit-diagram

Program / Code

Code is Explained in the Comments of the Code

int redPin = 11;
int greenPin = 10;
int bluePin = 9;

void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void loop() {
  // Red
  analogWrite(redPin, 255);
  analogWrite(greenPin, 0);
  analogWrite(bluePin, 0);
  delay(500);
  
  // Green
  analogWrite(redPin, 0);
  analogWrite(greenPin, 255);
  analogWrite(bluePin, 0);
  delay(500);
  
  // Blue
  analogWrite(redPin, 0);
  analogWrite(greenPin, 0);
  analogWrite(bluePin, 255);
  delay(500);
}

Thank you so much for going through our tutorial, we hope it was easy to follow and you enjoyed it, please share your feedback and pictures of the project (if you have made it) in the comments below .!

Share your love

Leave a Reply

Your email address will not be published. Required fields are marked *