Back to Parent

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

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

void loop(){
    // loop to blink 5 time
    for (int i=1; i<6; i++){
        digitalWrite(ledPin, HIGH);
        delay(500);
        digitalWrite(ledPin, LOW);
        delay(500);
    }
    // create a 3 second delay
    delay(3000);
}
Click to Expand

Content Rating

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

0