Image

Homework_02-LED lights-Jake Brzezicki

31 Oct

Homework_02-LED lights-Jake Brzezicki

int red = 3;//assigns LED to port 3
int blue = 5;
int green = 6;

void setup() {
pinMode(red, OUTPUT);//sets LED to output
pinMode(blue, OUTPUT);
pinMode(green, OUTPUT);

}

void loop() {

digitalWrite(blue, HIGH);//LED turns on
delay(150);
digitalWrite(green, LOW);//LED turns off
delay(150);
digitalWrite(red, LOW);
delay(150);
digitalWrite(blue, LOW);
delay(150);
digitalWrite(green, HIGH);
delay(150);
digitalWrite(red, HIGH);
delay(150);

}

Advertisements

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