B. Missing display.clearDisplay() before drawing text.
C. setTextSize() cannot be set to 2.
D. display.display() should be called before println().
Solution
Step 1: Check for display buffer clearing
Without clearDisplay(), old content may remain, causing overlapping text.
Step 2: Verify other commands
I2C address 0x3C is common and valid; setTextSize(2) is allowed; display() must be after drawing.
Final Answer:
Missing display.clearDisplay() before drawing text. -> Option B
Quick Check:
Always clearDisplay() before drawing new content [OK]
Hint: Always clear display before drawing new text [OK]
Common Mistakes:
Skipping clearDisplay() causing messy screen
Changing I2C address without checking hardware
Calling display() too early
5. You want to display a scrolling message on the SSD1306 OLED using I2C. Which approach correctly combines clearing the display, setting cursor, and updating the screen inside a loop?
hard
A. Inside loop: display(); clearDisplay(); setCursor(0,0); println(message); delay(200);
B. Inside loop: setCursor(0,0); println(message); display(); clearDisplay(); delay(200);
C. Inside loop: clearDisplay(); setCursor(0,0); println(message); display(); delay(200);
D. Inside loop: println(message); setCursor(0,0); clearDisplay(); display(); delay(200);
Solution
Step 1: Understand display update cycle
Each loop iteration must clear previous content, set cursor, write new text, then update display.
Step 2: Verify correct order of commands
clearDisplay() first clears buffer, setCursor() positions text, println() writes, display() sends buffer to screen, delay() controls speed.
Final Answer:
Inside loop: clearDisplay(); setCursor(0,0); println(message); display(); delay(200); -> Option C
Quick Check:
Clear, set cursor, print, display, delay = scrolling [OK]
Hint: Clear before print, then display inside loop for scrolling [OK]
Common Mistakes:
Calling clearDisplay() after display() causing blank screen
Setting cursor after printing text
Forgetting delay causing too fast updates
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.