0
0
Embedded Cprogramming~10 mins

Writing HIGH and LOW to output pins in Embedded C - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set pin 5 to HIGH.

Embedded C
digitalWrite(5, [1]);
Drag options to blanks, or click blank then click option'
AHIGH
BLOW
CINPUT
DOUTPUT
Attempts:
3 left
💡 Hint
Common Mistakes
Using LOW instead of HIGH will turn the pin off.
Using INPUT or OUTPUT in digitalWrite is incorrect.
2fill in blank
medium

Complete the code to set pin 3 to LOW.

Embedded C
digitalWrite(3, [1]);
Drag options to blanks, or click blank then click option'
AOUTPUT
BLOW
CINPUT
DHIGH
Attempts:
3 left
💡 Hint
Common Mistakes
Using HIGH will turn the pin on instead of off.
Using INPUT or OUTPUT is wrong in digitalWrite.
3fill in blank
hard

Fix the error in setting pin 7 to HIGH.

Embedded C
digitalWrite([1], HIGH);
Drag options to blanks, or click blank then click option'
ALOW
BHIGH
COUTPUT
D7
Attempts:
3 left
💡 Hint
Common Mistakes
Putting HIGH as the pin number causes errors.
Using OUTPUT or LOW as pin number is incorrect.
4fill in blank
hard

Fill both blanks to set pin 9 as output and then write HIGH to it.

Embedded C
pinMode([1], [2]);
digitalWrite(9, HIGH);
Drag options to blanks, or click blank then click option'
A9
BLOW
COUTPUT
DINPUT
Attempts:
3 left
💡 Hint
Common Mistakes
Using LOW or INPUT in pinMode instead of OUTPUT.
Using wrong pin number.
5fill in blank
hard

Fill all three blanks to set pin 4 as output, write LOW, then write HIGH.

Embedded C
pinMode([1], [2]);
digitalWrite(4, [3]);
digitalWrite(4, HIGH);
Drag options to blanks, or click blank then click option'
A4
BOUTPUT
CLOW
DINPUT
Attempts:
3 left
💡 Hint
Common Mistakes
Using INPUT instead of OUTPUT in pinMode.
Writing HIGH instead of LOW in the second digitalWrite.