Tiny Screens and Pixels

How small OLED screens and LED matrices work, what a sprite is and why one bit per pixel is enough

By Kevin McAleer,    4 Minutes

Page last updated November 21, 2026


Course Cover Image


A screen is a grid of lights

Look closely at any screen and you’ll find a grid of tiny lights called pixels. Your phone has millions. The screens we put on small robots have far fewer, and that’s what makes them fun: you can see and place every single one.

Two kinds turn up again and again in maker projects:

Screen Pixels Notes
LED matrix 8×8, 12×8, 16×16 Big chunky LEDs. Great for eyes and icons
SSD1306 OLED 128×64 About 2.5 cm wide, sharp and bright, very cheap

On both, each pixel is either on or off. There’s no colour and no grey. We call that 1-bit graphics, because one bit (a 1 or a 0) is all you need to store each pixel.


What is a sprite?

A sprite is a small picture that you draw once and then place wherever you like on the screen. Game characters are sprites. So are icons, and so is a robot’s eye.

Sprites save a lot of work. Draw one eye, and you can show it twice to make a pair. Draw five versions of it (open, half shut, shut, looking left, looking right) and you have an animation.

Each version is called a frame. Show the frames quickly, one after another, and the eye appears to move. It’s the same trick as a flip book.


Where things are: x and y

Every pixel has an address made of two numbers:

  • x counts across from the left edge, starting at 0
  • y counts down from the top edge, starting at 0

So on a 128×64 screen the top-left pixel is (0, 0) and the bottom-right is (127, 63).

Notice that y goes down. That’s the opposite of the graphs you draw in maths, and it catches everybody out once.

Try it. This box draws a 16×8 grid and lights one pixel:

WIDTH = 16
HEIGHT = 8

x = 3
y = 1

for row in range(HEIGHT):
    line = ""
    for col in range(WIDTH):
        if col == x and row == y:
            line += "#"
        else:
            line += "."
    print(line)

Change x and y and run it again. Where does (15, 7) land? What happens with (16, 0)?


How much memory does a picture need?

A microcontroller has very little memory, so it’s worth knowing what a picture costs.

Eight pixels fit in one byte, because a byte has eight bits. So:

Picture Pixels Bytes
8×8 icon 64 8
16×16 sprite 256 32
128×64 full screen 8,192 1,024

A whole OLED screen fits in about one kilobyte. A Raspberry Pi Pico has 264 of those, so you can afford plenty of sprites.


Try it Yourself

  1. In the code box above, light the four corner pixels one at a time. Write down their (x, y) addresses
  2. Work out how many bytes a 12×8 LED matrix picture needs. Careful: each row is stored in whole bytes, so a 12-pixel row takes 2 bytes, not 1.5
  3. On squared paper, shade in a 16×16 eye. You’ll draw it for real in two lessons’ time

Common Issues

Problem: My pixel appears lower than I expected. Solution: Remember that y counts down from the top. Why: Screens are drawn from the top row to the bottom row, so row 0 is at the top.

Problem: Nothing is lit when I use x = 16 on a 16-wide grid. Solution: Use 0 to 15. Why: Counting starts at 0, so the last column is the width minus one.


Check your understanding

Quick quiz 1 of 3

What does 1-bit mean for a screen?

Quick quiz 2 of 3

On a 128×64 screen, where is pixel (0, 63)?

Quick quiz 3 of 3

How many bytes does one 16×16 frame need?

< Previous Next >

You can use the arrows  ← → on your keyboard to navigate between lessons.

Course complete

Congratulations, you finished Pixel Art and Animation in Snakie!

That's all 14 lessons done. Let people know, it's a great way to inspire someone else to start.

Share card: I completed Pixel Art and Animation in Snakie on KevsRobots
Post Bluesky LinkedIn Facebook


What are you looking for?
Watch Videos Get Ideas Learn Something Read a Review Read the Blog Search
... Z Z z