By Kevin McAleer, 4 Minutes
Page last updated November 21, 2026
![]()
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.
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.
Every pixel has an address made of two numbers:
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:
Change x and y and run it again. Where does (15, 7) land? What happens with (16, 0)?
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.
(x, y) addressesProblem: 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.
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?
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments