0
0
Embedded Cprogramming~10 mins

LED-based debugging patterns 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 turn on the LED connected to pin 13.

Embedded C
digitalWrite([1], HIGH);
Drag options to blanks, or click blank then click option'
A13
B12
C10
D9
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong pin number will not light the LED.
2fill in blank
medium

Complete 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'
AOFF
BHIGH
CON
DLOW
Attempts:
3 left
💡 Hint
Common Mistakes
Using HIGH will keep the LED on.
3fill in blank
hard

Fix 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'
A12
BINPUT
C13
DHIGH
Attempts:
3 left
💡 Hint
Common Mistakes
Using INPUT instead of OUTPUT.
4fill in blank
hard

Fill 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'
A13
B1000
C500
D12
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong pin or delay time.
5fill in blank
hard

Fill 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'
A13
C500
D12
Attempts:
3 left
💡 Hint
Common Mistakes
Using different pins or wrong delay time.