/////////////////////////////////////Exercise 1:
int ledPin = D2;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(3000);
digitalWrite(ledPin, LOW);
delay(3000);
}
//////////////////////////////////////Exercise 2:
int ledPin = D2;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
for(int i = 0; i < 5; i++){
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(300);
};
delay(3000);
}
////////////////////////////////////////Exercise 3:
int ledPin = D2;
int ledPin2 = D3;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(ledPin2, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin2, LOW);
delay(300);
digitalWrite(ledPin, LOW);
digitalWrite(ledPin2, HIGH);
delay(300);
}
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .