Homework 02 -RGB LED – Tyler Cook

29 Oct

20131028_174122 20131028_174118

This code makes the lights turn on and turn off in a line.

int green2 = 3;     //defining that green2 is pin 3
int blue = 5;    //defining that blue is pin 5
int green = 6;   //defining that green is pin 6
int red = 10;    //defining that red is pin 10
void setup() {
  pinMode(red, OUTPUT);
  pinMode(blue, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(green2, OUTPUT);
                                  // loop that runs over and over
void loop() {
  digitalWrite(green2, HIGH);     // turn green2 on
  delay(200);                     // delay for 200 ms
  digitalWrite(red, HIGH);        // turn red on
  digitalWrite(blue, HIGH);       // turn blue on
  digitalWrite(green, HIGH);      // turn green on
  digitalWrite(green, LOW);       // turn green off
  digitalWrite(blue, LOW);        // turn blue off
  digitalWrite(red, LOW);         // turn red off
  digitalWrite(green2, LOW);      // turn green2 off

One Response to “Homework 02 -RGB LED – Tyler Cook”

  1. justinberken October 29, 2013 at 10:45 pm #

    Glad you were able to get the RGB bulb working as well.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s