SBRDIYables
Published © GPL3+

Working with RGB LED

This project demonstrates the working an RGB LED with Arduino.

BeginnerProtip1,794
Working with RGB LED

Things used in this project

Story

Read more

Schematics

Breadboard Diagram

Make connections as shown in the figure.
RGB: j25, j26, j27, j28
Resistor: f25 and d25
Resistor: f27 and d27
Resistor: f28 and d28

Jumper wire (red): PIN11 (Arduino) and a25 (breadboard)
Jumper wire (green): PIN10 (Arduino) and a27 (breadboard)
Jumper wire (blue): PIN9 (Arduino) and a28 (breadboard)
Jumper wire (black): h26 (breadboard) and GND

Code

working with RGB LED

Arduino
const int RED = 11;
const int GREEN = 10;
const int BLUE = 9;

void setup() {
  pinMode (RED, OUTPUT);
  pinMode (GREEN, OUTPUT);
  pinMode (BLUE, OUTPUT);
}

void loop() {
  analogWrite (RED, 255);
  analogWrite (GREEN, 0);
  analogWrite (BLUE, 0);
  delay (1000);
  analogWrite (RED, 0);
  analogWrite (GREEN, 255);
  analogWrite (BLUE, 0);
  delay (1000);
  analogWrite (RED, 0);
  analogWrite (GREEN, 0);
  analogWrite (BLUE, 255);
  delay (1000);
}

Credits

SBR
37 projects • 52 followers
Mechanical Engineer
DIYables
0 projects • 88 followers
I would like to invite you to join and add your projects to DIYables platform https://www.hackster.io/diyables

Comments