Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to turn on the LED connected to pin 13.
Embedded C
digitalWrite([1], HIGH); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong pin number.
Confusing HIGH and LOW values.
✗ Incorrect
The LED is connected to pin 13, so we use digitalWrite(13, HIGH); to turn it on.
2fill in blank
mediumComplete the code to make the LED blink by turning it off.
Embedded C
digitalWrite(13, [1]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using HIGH instead of LOW to turn off the LED.
Using undefined constants like ON or OFF.
✗ Incorrect
To turn the LED off, we use LOW with digitalWrite.
3fill in blank
hardFix the error in the code to set pin 13 as output.
Embedded C
pinMode([1], OUTPUT); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the wrong pin as output.
Confusing input and output modes.
✗ Incorrect
Pin 13 is the correct pin connected to the LED and must be set as output.
4fill in blank
hardFill both blanks to create a pattern that turns the LED on and off with a delay.
Embedded C
digitalWrite(13, [1]); delay([2]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using LOW to turn the LED on.
Using too short or too long delay values.
✗ Incorrect
Use HIGH to turn the LED on and 1000 milliseconds delay for 1 second.
5fill in blank
hardFill all three blanks to complete the loop that blinks the LED on and off with delays.
Embedded C
void loop() {
digitalWrite(13, [1]);
delay([2]);
digitalWrite(13, [3]);
delay([4]);
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping HIGH and LOW values.
Forgetting the delay between states.
✗ Incorrect
The LED is turned on with HIGH, then delayed 500 ms, then turned off with LOW, then delayed 500 ms again.