Complete the code to start the Arduino sketch with the setup function.
void [1]() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); }
loop instead of setup for initialization.The setup() function runs once when the sketch starts. It is used to initialize settings.
Complete the code to make the LED blink inside the loop function.
void loop() {
digitalWrite(LED_BUILTIN, [1]);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}LOW which turns the LED off.To turn the LED on, we use digitalWrite with HIGH.
Fix the error in the code to correctly upload and run the sketch.
void setup() {
pinMode(LED_BUILTIN, [1]);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}INPUT which disables output.The pin must be set as OUTPUT to control the LED.
Fill both blanks to complete the code that blinks the LED with a 500ms delay.
void loop() {
digitalWrite(LED_BUILTIN, [1]);
delay([2]);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}LOW to turn the LED on.The LED is turned on with HIGH and the delay is set to 500 milliseconds.
Fill all three blanks to complete the sketch that blinks the LED with a variable delay time.
int delayTime = [1]; void setup() { pinMode(LED_BUILTIN, [2]); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(delayTime); digitalWrite(LED_BUILTIN, [3]); delay(delayTime); }
INPUT instead of OUTPUT for pin mode.HIGH instead of LOW.The delay time is set to 500 milliseconds, the pin mode is OUTPUT, and the LED is turned off with LOW.
