Bird
0
0
Arduinoprogramming~10 mins

Why displays enhance projects in Arduino - Test Your Understanding

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

Complete the code to initialize the display in the setup function.

Arduino
void setup() {
  [1]();
}
Drag options to blanks, or click blank then click option'
Adisplay.begin()
Bdisplay.begin
Cdisplay.start()
Ddisplay.init
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting parentheses when calling display.begin
Using display.init which is not the correct function
Using display.start which does not exist
2fill in blank
medium

Complete the code to clear the display before drawing.

Arduino
void loop() {
  [1]();
  display.display();
}
Drag options to blanks, or click blank then click option'
Adisplay.clear()
Bdisplay.clearDisplay()
Cdisplay.reset()
Ddisplay.erase()
Attempts:
3 left
💡 Hint
Common Mistakes
Using display.clear() which does not clear the buffer
Using display.reset() which is not a valid function
Using display.erase() which does not exist
3fill in blank
hard

Fix the error in the code to print text on the display.

Arduino
display.setCursor(0, 0);
display.[1]("Hello World");
display.display();
Drag options to blanks, or click blank then click option'
AdrawText
Bprintln
Cwrite
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Using display.println() which is not supported by the display library
Using display.write() which prints bytes, not strings
Using display.drawText() which does not exist
4fill in blank
hard

Fill both blanks to set text size and color before printing.

Arduino
display.setTextSize([1]);
display.setTextColor([2]);
display.print("Hi");
Drag options to blanks, or click blank then click option'
A2
BWHITE
CBLACK
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using BLACK color which makes text invisible on black background
Using text size 2 when smaller text is needed
Confusing text size with color values
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps words to their lengths if length is greater than 3.

Arduino
auto lengths = [1]: [2] for (auto& word : words) if ([3] > 3);
Drag options to blanks, or click blank then click option'
Aword
Bword.length()
Dwords
Attempts:
3 left
💡 Hint
Common Mistakes
Using words as key instead of word
Using word instead of word.length() for value
Using wrong condition variable