← Back to Projects
EmbeddedShipped

Arduino TFT Tetris

Handheld Tetris on Arduino Nano + ST7735: game loop, SPI draw, buttons, and sound all on-device.

I wanted a real embedded game loop, not a simulation. Everything runs on the Nano: gravity, collision, scoring, SPI redraw, piezo cues. Half the 'bugs' were solder joints on the display. I staged controls on a two-button harness first so I was not debugging mechanics and firmware at the same time.

Engineering highlights

  • On-device game loop with collision, scoring, and piezo cues
  • SPI redraw tuned so controls stayed responsive
  • Fixed flaky display joints before rewriting game logic again
Date
2026
Focus
Embedded
Build stage
Playable prototype complete
Disciplines
Embedded Software · Hardware Bring-up
embeddedgame-loophardware-debuggingspi
Demo
Full write-up below. The hero is the short version. This is the build story: what I designed, what broke, and why I made the calls I did.

Motivation

Why I started this

What pulled me in, and what I wanted to get better at.

Why I built it

I wanted Tetris on hardware I could hold, with no host computer cheating on the game loop.

What interested me

Most of the scary bugs were solder and SPI bring-up pretending to be logic errors.

What I wanted to learn

Two-button harness first. Full controls later. Saves a lot of fake debugging.

System Overview

How the system fits together

Arduino Nano + ST7735 Tetris. Input, gravity, collision, scoring, redraw, and piezo cues all run on the board.

01

Game state

Compact grid and active tetromino representation.

02

Display pipeline

SPI ST7735 updates under Adafruit GFX.

03

Controls

Physical buttons with debounce.

04

Audio cues

Piezo events on lock/clear.

Data flow

Buttons → state update/collision → framebuffer/SPI → optional piezo.

Control flow

Single real-time loop; no OS scheduler to hide hitching.

Engineering Breakdown

Broken down by discipline

Each block covers the goal, the design, what broke, what changed, and what shipped.

01Embedded Game Loop

Embedded Game Loop

Goal

Keep controls responsive while redrawing on a constrained SPI panel.

Design

Main loop sequences input, gravity tick, collision, scoring, and redraw with a compact board representation.

Challenges

  • Panel init quirks differ by ST7735 variant.
  • Overdraw kills responsiveness.

Iterations

  • Logic on serial
  • Two-button prototype
  • Full handheld controls

Final implementation

Playable on-device Tetris with scoring and sound cues.

On-device play

Game loop, rendering, and controls on the Nano.

02Hardware Bring-up

Hardware Bring-up

Goal

Separate solder faults from logic faults.

Design

Display intermittents were chased at the joint before rewriting game code. Two-button staging reduced variables.

Challenges

  • Intermittent SPI looked like random sprite corruption.
  • Debounce and mechanical bounce mimic 'missed inputs.'

Iterations

  • Computer-driven prototype
  • Solder rework
  • Packaged buttons

Final implementation

Stable display path after joint-level fixes; playable handheld.

Display bring-up

Hardware faults first; then software polish.

Key Design Decisions

Calls I actually made

What else was on the table, what I picked, and why it still made sense once the hardware was real.

01

Fully on-device logic

The problem

Should a host computer own game state?

Alternatives considered

  • Host-assisted
  • Bare-metal on MCU

Tradeoffs

Host is easier; on-device teaches real timing and memory limits.

Why I chose this

Everything on the Nano.

Evolution

How it got here

Bench bring-up, CAD fits, soldering, and the demos in between. Not just the final photo.

  1. v1

    Two-button harness

    Prove controls and loop.

    No media for this milestone yet.
  2. v2

    SPI bring-up

    Fix joints and init quirks.

    No media for this milestone yet.
  3. v3

    Playable build

    Full rules + sound cues.

    No media for this milestone yet.

Results & Validation

What held up

What worked in the end, what I can show for it, and where it's still limited.

Playable prototype

Gameplay and bring-up videos

Real-time Tetris with physical controls on ST7735.

Limitations

  • Enclosure polish and difficulty ramps still open.

Reflection

Looking back

What surprised me, what I'd redo, and questions I'm still chewing on.

What surprised me

  • Most 'logic bugs' were solder.

What I would redesign

  • Earlier fixture for display continuity tests.

Future improvements

  • Rotation polish, difficulty ramps, enclosure.

Questions that emerged

  • How do you budget redraw vs input latency on 8-bit-class boards?