Arduino Beginner Project #2: How to Blink RGB (Red Green Blue) LED using Arduino Uno

 


Arduino Beginner Project #2: How to Blink RGB (Red Green Blue) LED using Arduino Uno

 

Objective: 

 To produce red, green and blue light continuously with an interval of 1 second.

 

Components:

  • Arduino Uno with USB cable
  •  Breadboard
  • Male to male jumper
  • RGB LED
  • (3X) Resistor 220 Ohm

 

Schematic Circuit:


 

 

Coding using Arduino IDE:

 

#define RED_DIODE 13
#define GREEN_DIODE 11
#define BLUE_DIODE 9

void setup() {
  pinMode (RED_DIODE,OUTPUT);
  pinMode (GREEN_DIODE,OUTPUT);
  pinMode (BLUE_DIODE,OUTPUT);

}

void loop() {
  digitalWrite (RED_DIODE,HIGH);
  digitalWrite (GREEN_DIODE,LOW);
  digitalWrite (BLUE_DIODE,LOW);
  delay(1000);

  digitalWrite (RED_DIODE,LOW);
  digitalWrite (GREEN_DIODE,HIGH);
  digitalWrite (BLUE_DIODE,LOW);
  delay(1000);

  digitalWrite (RED_DIODE,LOW);
  digitalWrite (GREEN_DIODE,LOW);
  digitalWrite (BLUE_DIODE,HIGH);
  delay(1000);

}

 

Download this project code here: https://drive.google.com/uc?export=download&id=1oFAk1dqbz13rrR86-MU6E4X9jbCcFDey


Watch this project tutorial on Youtube:

 

Thank you.


 

 


Comments

Popular posts from this blog

IoT Beginner Project #2: How to Monitor Temperature Data with LED Alert using BLYNK App

IoT Beginner Project #1: How to Blink LED using BLYNK App Button with Internet of Things (IoT) via ESP32 Wifi