int ledPin1 = D2;
int ledPin2 = D4;
int currLit, currOff, temp;
void setup() {
// We want to tell the Argon that we'll use
// D2 and D4 as output pins.
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
currLit = ledPin1;
currOff = ledPin2;
}
void loop() {
// First... On
digitalWrite(currLit, HIGH); // Turn ON the LED pins
// Now... Off
digitalWrite(currOff, LOW); // Turn OFF the LED pins
delay(1000); // Wait for 1000mS = 1 second
// rinse + repeat
temp = currLit;
currLit = currOff;
currOff = temp;
}
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .