Skip to main content
Version: FILS English

IronBeats

A high-frequency rhythm game built on bare-metal Rust, featuring a 32-row LED "runway" and deterministic millisecond scoring.

info

Description

IronBeats is a 3-lane rhythm game (inspired by Piano Tiles and Guitar Hero) developed for the STM32F767ZI microcontroller. The game utilizes a 4-in-1 MAX7219 LED Matrix (8x32) as the primary game board where "notes" fall vertically. Players must interact with three physical buttons to catch notes within a strict timing window. A secondary 1.3" OLED displays the menu system, real-time score, and persistent leaderboard saved in the internal Flash memory. The project emphasizes deterministic latency and real-time concurrency using the Rust Embassy framework.

Motivation

The choice of this project stems from a desire to explore Real-Time Systems and Hardware-Software Co-design. Developing a rhythm game requires solving critical engineering problems:

  1. Deterministic Latency: Ensuring that button interrupts are processed with sub-millisecond precision.

  2. Resource Management: Efficiently sharing a single SPI bus between two distinct display technologies (OLED and LED Matrix).

  3. Rust in Embedded: Leveraging Rust's ownership model and the Embassy async executor to manage multiple concurrent tasks (audio, visuals, and logic) without a traditional Operating System.

Architecture

The system is centralized around the STM32F767ZI (Cortex-M7) which handles the high-speed game loop, user input debouncing, and peripheral data streaming. [POWER & DEBUGGING SECTION] +-------------------+ +-------------------+ | Host PC | | Host PC | | (Power Bank) | | (Serial Debugging)| +---------+---------+ +---------^---------+ | | | (5V USB) | [UART / VCP] v v +---------------------------------------------------+ | | | NUCLEO-F767ZI (Cortex-M7) | | (Main Microcontroller) | | | +--------+------------+------------+-----------+----+ | | | | [SPI] [SPI] [PWM] [GPIO] | | | | v v v v +------------+ +------------+ +---------+ +------------+ | MAX7219 | | 1.3" SH1106| | 3x Pass.| | 3x Buttons | | 8x32 LED | | OLED Disp. | | Buzzers | | 1x Joystick| | Matrix | | | | | | | +------------+ +------------+ +---------+ +------------+ (Game Board) (UI/Score) (Audio) (Controls)

Log

Week 1 - 7

Brainstormed the idea and consulted my professors regarding the project idea. Hardware acquisition finalized (STM32, MAX7219, SH1106 OLED).

Weeks 7-9

Developed the project logic and power scheme as well as implemented basic GPIO blinky and serial logging for debuggin every component involved in the project.

Weeks 8-10

Weeks 10-12

Weeks 12-14

Hardware

IronBeats is a bare-metal Rust rhythm game powered by an STM32F767ZI microcontroller, ensuring precise gameplay timing. An 8x32 LED matrix serves as the vertical runway for falling notes, while a 1.3" OLED handles menus and leaderboards. Three tactile buttons let players catch notes in specific lanes, with three passive buzzers providing real-time audio feedback. A joystick controls UI navigation, and a 5V power bank safely drives the entire hardware system

Schematics

Place your KiCAD or similar schematics here in SVG format.

Bill of Materials

DeviceUsagePrice
STM32F767ZI Nucleo-144Main Controller (Cortex-M7)165 RON
4-in-1 MAX7219 8x32 MatrixMain 32-row game board45 RON
Waveshare 1.3" OLED (SH1106)UI, Score, and Menu Display68 RON
Passive Buzzer Module (3x)Tri-lane audio feedback15 RON
Joystick ModuleMenu navigation12 RON
Tactile Buttons (3x)Gameplay lane inputs3 RON
1000uF CapacitorPower smoothing for LED Matrix2 RON

Software

LibraryDescriptionUsage
embassy-stm32Async HAL for STM32Main framework for task management and peripheral control.
embedded-graphics2D Graphics LibraryUsed for rendering the menu and score on the OLED.
sh1106SH1106 OLED DriverLow-level driver for the 1.3" SPI display.
max7219MAX7219 LED DriverHandling the daisy-chained 8x32 LED matrices.
embedded-storageFlash storage abstractionUsed for persistent leaderboard management.
  1. STM32F767ZI Reference Manual
  2. Rust Embedded Book
  3. Embassy Async Framework Documentation
  4. MAX7219 Daisy Chaining Logic Explained