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 will not light the LED.
✗ Incorrect
The LED is connected to pin 13, so we use 13 to turn it on.
2fill in blank
mediumComplete the code to blink the LED 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 will keep the LED on.
✗ Incorrect
To turn off the LED, we set the pin to LOW.
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
Using INPUT instead of OUTPUT.
✗ Incorrect
Pin 13 must be set as OUTPUT to control the LED.
4fill in blank
hardFill both blanks to create a pattern that turns the LED on and off with delay.
Embedded C
digitalWrite([1], HIGH); delay([2]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong pin or delay time.
✗ Incorrect
Pin 13 controls the LED, and delay(1000) waits 1 second.
5fill in blank
hardFill all three blanks to complete the LED blink loop.
Embedded C
pinMode([1], OUTPUT); while(1) { digitalWrite([2], HIGH); delay([3]); }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different pins or wrong delay time.
✗ Incorrect
Pin 13 is set as output and used to blink the LED every 500 ms.