06 May, 2010

Getting 2 reds and 1 green flashing!

15 minutes after the video conference on Thursday me and Nich got 2 LEDs that were red and 1 green to oscillate.

Here is the code


int green = 12;
int red1 = 11;
int red2 = 10;
int t = 1000;

void setup() {
pinMode(green, OUTPUT);
pinMode(red1, OUTPUT);
pinMode(red2, OUTPUT);
}

void loop() {
digitalWrite(red1, HIGH);
digitalWrite(red2, HIGH);
digitalWrite(green, LOW);
delay(t);

digitalWrite(red1, LOW);
digitalWrite(red2, LOW);
digitalWrite(green, HIGH);
delay(t);
}

No comments:

Post a Comment