Learning ARDUINO for Beginners EP#2 Digital Outputs

In this episode we will learn how to use digital outputs on the ARDUINO board by controlling the color of a RGB LED.

 

#define blue 8
#define green 9
#define red 10

void setup() {
pinMode(blue,OUTPUT);
pinMode(green,OUTPUT);
pinMode(red,OUTPUT);

}

void loop() {
digitalWrite(blue,HIGH);
delay(2000);
digitalWrite(blue,LOW);
digitalWrite(green,HIGH);
delay(2000);
digitalWrite(green,LOW);
digitalWrite(red,HIGH);
delay(2000);
digitalWrite(red,LOW);

}