Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set pin 13 to HIGH.
Arduino
digitalWrite(13, [1]);
Attempts:
3 left
💡 Hint
Common Mistakes
Using LOW instead of HIGH turns the pin off.
Using INPUT or OUTPUT in digitalWrite() is incorrect.
✗ Incorrect
digitalWrite() sets the voltage of the pin. HIGH means 5V (on).
2fill in blank
mediumComplete the code to turn off the LED connected to pin 9.
Arduino
digitalWrite(9, [1]);
Attempts:
3 left
💡 Hint
Common Mistakes
Using HIGH will keep the LED on.
INPUT and OUTPUT are not valid values for digitalWrite().
✗ Incorrect
LOW sets the pin voltage to 0V, turning the LED off.
3fill in blank
hardFix the error in the code to set pin 7 HIGH.
Arduino
digitalWrite([1], HIGH);Attempts:
3 left
💡 Hint
Common Mistakes
Putting HIGH as the pin number causes errors.
Using OUTPUT or LOW as pin number is incorrect.
✗ Incorrect
The first argument must be the pin number, here 7.
4fill in blank
hardFill both blanks to turn pin 5 off and pin 6 on.
Arduino
digitalWrite([1], LOW); digitalWrite([2], HIGH);
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping pin numbers or voltage values.
Using HIGH where LOW is needed.
✗ Incorrect
Pin 5 is set to LOW to turn off, pin 6 to HIGH to turn on.
5fill in blank
hardFill all three blanks to set pin 3 HIGH, pin 4 LOW, and pin 8 HIGH.
Arduino
digitalWrite([1], HIGH); digitalWrite([2], LOW); digitalWrite([3], HIGH);
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up pin numbers or voltage states.
Using pin 5 which is not in the task.
✗ Incorrect
Pin 3 and 8 are set HIGH to turn on, pin 4 LOW to turn off.
