Back to Parent

//Declare variable ledPin as an integer
//Set ledPin to D2 on argon

int ledPin = D2;

//Set ledPin2 to D4 on argon

int ledPin2 = D4;

//setup is called once every time a program is run 
void setup() {
    
    //tell argon to use D2 as an output pin
    pinMode(ledPin, OUTPUT);
    //tell argon to use D4 as an output pin
    pinMode(ledPin2, OUTPUT);

}

void loop() {
    //turns pin (red) on
    digitalWrite(ledPin, HIGH);
    //for 1000 milliseconds
    delay(1000);
    //turns pin (red) off
    digitalWrite(ledPin, LOW);
    //for 1000 milliseconds
    delay(1000);
    //turns pin (blue) on
    digitalWrite(ledPin2, HIGH);
    //for 1000 milliseconds
    delay(1000);
    //turns pin (blue) off
    digitalWrite(ledPin2, LOW);
    //for 1000 milliseconds
    delay(1000);
    //repeats loop
    

}
Click to Expand

Content Rating

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

0