Source: https://mokxi.com/teachers/plans/oled-graphics
Updated: 2026-11-19

Lesson plan

# OLED graphics and fonts lesson plan

Pixel screens on an Uno with 2 KB of RAM: the SSD1306’s 1 KB framebuffer byte by byte, lines and circles, fonts, sprites, U8g2’s page mode, an SH1106 beside it through a TCA9548A, and a two-screen pocket space game.

4 chapters, 7 lessons, about 6 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- The framebuffer, and the shapes drawn into it.
- Fonts, bitmaps and a sprite that flies.
- Page mode, and two screens that share one address.
- A pocket space game with a dashboard on a second screen.

### Materials for the whole unit

- Arduino Uno R3
- Half breadboard
- I2C multiplexer, TCA9548A
- OLED display, 1.3 inch SH1106
- OLED display, 128x64
- Potentiometer
- Pushbutton

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 40 min

## Pixels in memory

The framebuffer, and the shapes drawn into it.

Lesson | Time | What students do

The SSD1306 framebuffer A 128x64 OLED is 1024 bytes in eight pages. Write bytes straight into the frame, count the pixels they light, and see what that kilobyte costs an Uno with 2048 bytes of RAM. | 50 min

- Run it
- Half the RAM, gone
- Bytes stand on end
- The bottom row
- A column down the middle
- A thicker stripe
- Why this layout

Pixels and lines Adafruit_GFX lines, rectangles and circles, each one’s pixels counted, then a radar whose sweep follows a knob, and the trick that sends 29 ms of changes instead of a 348 ms frame. | 50 min

- A line is a staircase
- Rectangles share corners
- Circles
- The radar
- Sweep it
- Point it anywhere
- A bigger circle

### Materials

- Arduino Uno R3
- Half breadboard
- OLED display, 128x64
- Potentiometer
- Pushbutton

### Check for understanding

Each student finishes "Pixels and lines" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A bigger circle".

Chapter 2. About 1 h 40 min

## Text and pictures

Fonts, bitmaps and a sprite that flies.

Lesson | Time | What students do

Fonts The built-in 6x8 cell at sizes 1 to 3, getTextBounds() to center a score that follows a knob, and a GFXfont whose cursor sits on the baseline, the classic OLED gotcha. | 50 min

- Three sizes
- Center the score
- Turn the knob
- On the screen
- The baseline gotcha
- Go bigger
- What fonts cost

Bitmaps and sprites A 16x16 rocket packed into 32 bytes of flash, flown across a starfield: the knob climbs, the button fires a laser, and each frame rubs out only where the ship was. | 50 min

- Thirty-two bytes of rocket
- Fly a lap
- Climb
- Fire
- Count the screen
- Full speed
- Make your own sprite

### Materials

- Arduino Uno R3
- Half breadboard
- OLED display, 128x64
- Potentiometer
- Pushbutton

### Check for understanding

Each student finishes "Bitmaps and sprites" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make your own sprite".

Chapter 3. About 1 h 35 min

## Less RAM, more screens

Page mode, and two screens that share one address.

Lesson | Time | What students do

U8g2 pages U8g2’s picture loop draws Saturn one page at a time: a 128-byte buffer, eight passes a frame, and the strict rule that every pass draws the same picture. Plus an honest note on what Mokxi models. | 45 min

- A different library
- The picture loop
- Move the moon
- Saturn on the screen
- What is real here, and what is not
- Two pages at a time

SH1106 and two screens An SSD1306 and an SH1106, both at 0x3C, behind a TCA9548A. The Uno has room for one 1 KB frame, so the SH1106 is drawn a page at a time through a 128-byte strip, from column 2. | 50 min

- Two screens, one address
- No room for a second frame
- Choose a channel
- The left screen
- The right screen, a page at a time
- Turn the knob
- What makes an SH1106 different

### Materials

- Arduino Uno R3
- Half breadboard
- I2C multiplexer, TCA9548A
- OLED display, 1.3 inch SH1106
- OLED display, 128x64
- Potentiometer
- Pushbutton

### Check for understanding

Each student finishes "SH1106 and two screens" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "What makes an SH1106 different".

Chapter 4. About 1 h

## Boss project

A pocket space game with a dashboard on a second screen.

Lesson | Time | What students do

Boss: a pocket dashboard A pocket space game on two screens: a rocket dodging asteroids on the SSD1306, a fuel gauge, score and high score on the SH1106. One 1 KB frame, one 128-byte strip, a laser and shields. | 60 min

- Launch
- The game screen
- The dashboard
- Fire!
- Crash
- Dodge
- Shields up
- Make it yours and share it

### Materials

- Arduino Uno R3
- Half breadboard
- I2C multiplexer, TCA9548A
- OLED display, 1.3 inch SH1106
- OLED display, 128x64
- Potentiometer
- Pushbutton

### Check for understanding

Each student finishes "Boss: a pocket dashboard" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours and share it".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
