Draw Text in Multiple Sizes
Print labels and values at different scales.
Draw Text in Multiple Sizes is a free Arduino & IoT Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Text Is Just Pixels
The OLED has no letters built in. The GFX library paints each character as a tiny pattern of pixels, so you control exactly how text looks. ✍️
Pick a Text Color
On a monochrome OLED, color means on or off. Call setTextColor with WHITE so your letters light up against the dark background.
display.setTextColor(WHITE);Set the Text Size
setTextSize(1) draws the base 6x8 pixel font. Larger numbers scale that same shape up, trading sharpness for readability from a distance.
display.setTextSize(1);How Size Scaling Works
Size 2 doubles every pixel, so a letter becomes 12x16. Size is a whole-number multiplier, not a point value, so jumps are chunky but predictable.
Place the Cursor
setCursor(x, y) sets where the next text starts. The top-left corner is (0,0), and x grows right while y grows down the screen.
display.setCursor(0, 0);Print Some Text
Now write words with print or println. They behave like the Serial Monitor, but the output lands on your OLED at the cursor.
display.print("Hello!");Print Numbers Too
You can pass variables straight to print. Mix labels and values to show live data like a temperature reading right on the screen.
display.print("Temp: ");
display.print(temp);A Bold Title
Combine a big title with small details below. Use size 2 for a headline, then drop back to size 1 for the data lines underneath.
display.setTextSize(2);
display.setCursor(0, 0);
display.print("STATUS");Move to a New Line
The cursor does not auto-wrap nicely for layouts. For a clean second line, call setCursor again with a larger y value to drop down.
display.setCursor(0, 20);Always Refresh
Remember the rhythm: clearDisplay, set size and cursor, print, then display. Skip the final display and your fresh text never shows up.
display.clearDisplay();
display.print("Ready");
display.display();Mind the Edges
Big text eats space fast. A size-2 line is 16 pixels tall, so on a 64-pixel screen you fit only a few rows before running off the bottom.
Quick Check
You want letters twice as tall as the default font.
Recap
You set color, chose a text size, positioned the cursor, and printed labels with values. Headlines big, data small, always end with display.
Frequently asked questions
Is the “Draw Text in Multiple Sizes” lesson free?
Yes — the full text of “Draw Text in Multiple Sizes” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.
What will I learn in “Draw Text in Multiple Sizes”?
Print labels and values at different scales. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Arduino & IoT Academy?
No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Draw Text in Multiple Sizes” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Arduino & IoT Academy lesson?
Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Wire & Init an SSD1306 OLED
- Draw Text in Multiple Sizes
- Lines, Rectangles & Circles
- Animate a Bar Graph