Back to Parent

// declare a variable and load it with value
int ledPin = D2;

void setup(){
    // set D2 as output pin
    pinMode(ledPin, OUTPUT);
}

void loop(){
    //switch it on
    digitalWrite(ledPin, HIGH);
    // wait for three seconds
    delay(3000);
    // switch it off
    digitalWrite(ledPin, LOW);
    // wait for three seconds
    delay(3000);
    // repeat
}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0