Creative solution
Published

Using RGB LED

The RGB led consists of three different led's, from the name you can guess that these LEDs are red, green and blue. We can obtain many othe

BeginnerFull instructions provided1,002
Using RGB LED

Things used in this project

Story

Read more

Schematics

How to setup

Code

RGB Led

Arduino
int red_light_pin= 11;
int green_light_pin = 10;
int blue_light_pin = 9;
void setup() {
  pinMode(red_light_pin, OUTPUT);
  pinMode(green_light_pin, OUTPUT);
  pinMode(blue_light_pin, OUTPUT);
}
void loop() {
  RGB_color(255, 0, 0); // Red
  delay(200);
   RGB_color(255, 0, 0); // Red
  delay(200);
  RGB_color(0, 255, 0); // Green
  delay(200);
  RGB_color(0, 0, 255); // Blue
  delay(200);
  RGB_color(255, 255, 125); // Raspberry
  delay(200);
  RGB_color(0, 255, 255); // Cyan
  delay(200);
  RGB_color(255, 0, 255); // Magenta
  delay(200);
  RGB_color(255, 255, 0); // Yellow
  delay(200);
  RGB_color(255, 255, 255); // White
  delay(200);

}
void RGB_color(int red_light_value, int green_light_value, int blue_light_value)
 {
  analogWrite(red_light_pin, red_light_value);
  analogWrite(green_light_pin, green_light_value);
  analogWrite(blue_light_pin, blue_light_value);
}

Credits

Creative solution

Creative solution

7 projects • 5 followers

Comments