LOGIN
Murali Mano Joshi
3
Collaborator
Mechanical Engineer
 · RamanathapuramIndia
Share
Report
Get Link
TUTORIAL

Class1: RGB Blink

// void setup() {
pinMode(9, OUTPUT); 
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop() {
digitalWrite(9, HIGH); // turns on red
digitalWrite(11, LOW); // turns off blue
delay(1000); 
digitalWrite(10, HIGH); // turns on green
digitalWrite(9, LOW); // turns off red
delay(1000); 
digitalWrite(11, HIGH); // turns on blue
digitalWrite(10, LOW); // turns off green
delay(1000); 
}

Description:
We use setup() to configure the state of input and output pins, as well as other actions that we only need to run once. Conversely, loop() will perform what ever actions are inside of it. Here we have taken the PIN 9,10,11 for red, green, blue. Pin mode() is used to set the pin either input or output. Here we set those pin at output.
Inside the Loop(). We use Digital Write() and Delay(). Both are statement where as Digital Write() used to blow the respective color. High indicates blow on the color. If you like you may change the cycle order to GRB. Delay() is used for time delay 1000 stands for 1000ms that mean 1sec.
Connection:
Before made a connection. Take a small look at the architecture of your Arduino. RGB LED has four Pins 1,3,4 for red, green, blue respectively. 2 for GND. connect the pin 9, 10, 11 to 1, 3, 4 for LED intermittently connect the transistor for each pin respectively by using a bread board.
Note: I’m just a beginner so my post might have a flaw. If you found report me soon or else have any queries ask me I will try to clarify it.

Meet you at next post.

Arduino
2 likes 
Like
Award Contribution
Leave a reply...
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
New Post
Help
Start Project
Online Users
Share Link
Write something before you submit it!
Photo updated
Request Sent!
Updated
Copied to Clipboard