Bird
0
0
Arduinoprogramming~10 mins

Seven-segment display control in Arduino - 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 2 as an output.

Arduino
pinMode([1], OUTPUT);
Drag options to blanks, or click blank then click option'
A2
B13
C0
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using a pin number not connected to the display.
2fill in blank
medium

Complete the code to turn on segment A by setting pin 2 HIGH.

Arduino
digitalWrite([1], HIGH);
Drag options to blanks, or click blank then click option'
A13
B4
C7
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using a pin number not connected to segment A.
3fill in blank
hard

Fix the error in the code to turn off segment B connected to pin 3.

Arduino
digitalWrite([1], LOW);
Drag options to blanks, or click blank then click option'
A2
B3
C5
D6
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong pin number for segment B.
4fill in blank
hard

Fill both blanks to create a function that turns on segment C connected to pin 4.

Arduino
void turnOnSegmentC() {
  digitalWrite([1], [2]);
}
Drag options to blanks, or click blank then click option'
A4
BHIGH
CLOW
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the pin to LOW instead of HIGH.
Using the wrong pin number.
5fill in blank
hard

Fill all three blanks to create a function that turns off segments D and E connected to pins 5 and 6.

Arduino
void turnOffSegments() {
  digitalWrite([1], [2]);
  digitalWrite([3], LOW);
}
Drag options to blanks, or click blank then click option'
A5
BLOW
C6
DHIGH
Attempts:
3 left
💡 Hint
Common Mistakes
Setting pins to HIGH instead of LOW.
Using wrong pin numbers.