Back to Parent

//Setup variables

int led = D2;
//orange LED
int led1 = D3;
//green LED
//it is obvious that the green LED is much lower in brightness

void setup() {
    
    pinMode( led, OUTPUT );
    pinMode( led1, OUTPUT );

}

void loop() {

    digitalWrite( led, HIGH );
    digitalWrite( led1, LOW );
    delay( 1000 );
 
    digitalWrite( led1, HIGH );
    digitalWrite( led, LOW );
    delay( 1000 );
//turning one of them on and another off together at the same time

}
Click to Expand

Content Rating

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

0