Back to Parent

//writing the code to make the LED blink every 3 seconds

// name and assign the pin

int led = D2;

void setup() {
//configure PIN to be an output pin

 pinMode( led, OUTPUT );
 
}

void loop() {

for(int i=0; i<5;i++)
{
    digitalWrite( led,HIGH );
    delay ( 500 );
    
    digitalWrite( led,LOW );
    delay ( 500 );
}

digitalWrite(led,LOW);
delay(3000);
    //repeat and repeat and repeat
}
Click to Expand

Content Rating

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

0