Making Things Interactive

January 28, 2008

Assignment 3.

Filed under: 3: LadyAda Tutorials,Assignments,Students — lcc1006 @ 6:40 pm
Tags: ,

This is my first time working with circuits and any coding software. It wasn’t as frustrating as i thought.

int bluePin = 12; // BLue LED connected to digital pin 12
int redPin = 11; // Red LED connected to digital pin 11
int greenPin = 10; // Green LED connected to digital pin 10

void setup() // run once, when the sketch starts
{
pinMode(bluePin, OUTPUT); // sets the digital pin as output
pinMode(redPin, OUTPUT); // sets the digital pin as output
pinMode(greenPin, OUTPUT); // sets the digital pin as output
}

void loop() // run over and over again
{
digitalWrite(bluePin, HIGH);
digitalWrite(redPin, LOW);
digitalWrite(greenPin, LOW);
delay(3000);
digitalWrite(bluePin, HIGH);
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
delay(3000);
digitalWrite(bluePin, LOW);
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
delay(3000);
digitalWrite(bluePin, LOW);
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, HIGH);
delay(3000);
digitalWrite(bluePin, LOW);
digitalWrite(redPin, LOW);
digitalWrite(greenPin, HIGH);
delay(3000);
digitalWrite(bluePin, HIGH);
digitalWrite(redPin, LOW);
digitalWrite(greenPin, HIGH);
delay(3000);
}


Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: