Complete the code to set the LED pin as output in the setup function.
void setup() {
pinMode(13, [1]);
}
void loop() {
// LED blink code here
}The pinMode function sets the pin mode. To blink an LED, the pin must be set as OUTPUT.
Complete the code to turn the LED on inside the loop function.
void loop() {
digitalWrite(13, [1]);
delay(1000);
}To turn the LED on, the pin must be set to HIGH using digitalWrite.
Fix the error in the delay time to make the LED blink every half second.
void loop() {
digitalWrite(13, HIGH);
delay([1]);
digitalWrite(13, LOW);
delay(500);
}The delay time is in milliseconds. To blink every half second, use 500 ms.
Fill both blanks to create a blink pattern where the LED is on for 300 ms and off for 700 ms.
void loop() {
digitalWrite(13, [1]);
delay([2]);
digitalWrite(13, LOW);
delay(700);
}The LED should be turned on with HIGH and stay on for 300 milliseconds.
Fill all three blanks to create a pattern where the LED blinks twice quickly (200 ms on, 200 ms off) then stays off for 1000 ms.
void loop() {
digitalWrite(13, [1]);
delay([2]);
digitalWrite(13, LOW);
delay([3]);
digitalWrite(13, [1]);
delay([2]);
digitalWrite(13, LOW);
delay(1000);
}The LED is turned on with HIGH for 200 ms, then off for 200 ms, repeated twice, then off for 1000 ms.
