How To Interface RGB Led With Arduino Uno By Technoesolution | #arduinoprojects
January 30, 2022
Description
In this article, I will show you how to "Interface RGB LED With Arduino Uno" in a few steps. I provide complete details of the project like Circuit Diagram & Arduino Code. Refer to the circuit diagram to make proper connections.
Material Required:-
(Following links are affiliated links, If you buy from this link we will get some bonus from it.)
Circuit Diagram:-
Refer above circuit diagram to make proper connections.
Arduino Code:-
/*
   Hello guys welcome back to "Techno-E-Solution"
   Project Name:- How To Interface RGB Led With Arduino Uno
   Project Video:- https://youtu.be/Y4QHVRjflCQ
*/
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(1000);
  RGB_color(0, 255, 0); // Green
  delay(1000);
  RGB_color(0, 0, 255); // Blue
  delay(1000);
  RGB_color(255, 255, 125); // Raspberry
  delay(1000);
  RGB_color(0, 255, 255); // Cyan
  delay(1000);
  RGB_color(255, 0, 255); // Magenta
  delay(1000);
  RGB_color(255, 255, 0); // Yellow
  delay(1000);
  RGB_color(255, 255, 255); // White
  delay(1000);
}
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);
}Demonstration:-
If you got this article helpful, Subscribe to our blog & youtube channel for more interesting projects.
You can Buy me a coffee If you got this article helpful.

Post a Comment