0
0
Embedded Cprogramming~10 mins

LED control 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.
Confusing HIGH and LOW values.
2fill in blank
medium

Complete 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'
AHIGH
BLOW
CON
DOFF
Attempts:
3 left
💡 Hint
Common Mistakes
Using HIGH instead of LOW to turn off the LED.
Using undefined constants like ON or OFF.
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'
A13
B11
C12
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the wrong pin as output.
Confusing input and output modes.
4fill in blank
hard

Fill 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'
AHIGH
BLOW
C1000
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using LOW to turn the LED on.
Using too short or too long delay values.
5fill in blank
hard

Fill 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'
AHIGH
B500
CLOW
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping HIGH and LOW values.
Forgetting the delay between states.