Skip to main content
Version: FILS English

Catch the falling apples

A remake of a classic arcade game where you catch as many apples as you can

info

Author: Radu Ana-Maria-Gabriela
Github Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-anamariaradu6

Description

“Catch the falling apples” is a classic arcade game controlled by the STM32 Nucleo-U545RE-Q. The game is displayed on a 1.8-inch screen, where apples fall from the top of the screen and the user has to catch them using a basket. The movement of basket is controlled with a biaxial joystick.

Motivation

Ever since I was a kid, I’ve been passionate about playing games in my free time. When I started learning how to code, I wanted to start making my own game. However, building a modern and complex game requires a lot of time, resources and knowledge. So for this project, I decided to recreate a classic game from my childhood, with the help of hardware components, not only digitally.

Architecture

This project's architecture revolves around the STM32 Nucleo-U545RE-Q microcontroller.

  • STM32 Nucleo-U545RE-Q
  • Breadboard: allows easy connections among the components of the project
  • LCD SPI 128x160 Module: the screen where the game will be displayed.
  • Joystick breakout board: the joystick which will be used to move the basket to the left or to the right.
  • 3 Blue LEDs: the LEDs which will show the remaining lives of the player. They are all turned on when the game starts and one of them turns off when an apple falls on the ground.
  • 1 RGB LED: this LED will turn green when the player catches and apple, red when an apple falls on the ground and when the player loses the game, and yellow for a 3-seconds countdown before the game starts.
  • 2 Passive Buzzers: one of these buzzers will make a sound each time the player loses one life. The other buzzer will make different sounds when the game starts and when it ends.

hardware scheme

Log

Week 30 March - 5 April

I sent my project idea and received feedback.

Week 6 - 12 April

I ordered the components based on the feedback and picked them up.

Week 13 - 19 April

I did some initial testing to see if the components work.

Week 20 - 26 April

I continued the testing, wrote the page of the website and started writing the actual code of the project.

Hardware

Schematic

(The KiCAD schematic will be here later)

Bill of materials

DeviceUsagePrice
STM32 Nucleo-U545RE-QMain microcontrollerborrowed
BreadboardConnects the microcontroller to the components21.18 RON
LCD SPI 128x160 ModuleDisplays the game24.59 RON
Joystick breakout boardControls the movement of the basket5.35 RON
Blue LEDsShows the remaining lives of the player0.87 RON
RGB LEDShows visual cues1 RON
Passive BuzzersAudio cues2 RON

Software

Library/CrateDescriptionUsage in project
embassy-stm32Hardware abstraction layer for STM32Provides type-safe access to peripherals (SPI, GPIO, PWM, ADC, timers)
embassy-syncProvider of synchronization primitivesAllows tasks to communicate without blocking each other
embassy-futuresCollection of utilities for working with FuturesMakes sure the game does not freeze and keeps running
embassy-executorThe async runtimeRuns main game loop
embassy-timeEfficient for async embedded applicationsControls falling speed timing, delays and time durations
defmtEfficient embedded logging frameworkDebugs and tracks game changes
embedded-graphics2D graphics library for no_std embedded devicesDraws the apples, basket and score text
embedded-halTraits for reading analog values and digital pinsReads joystick axis and converts raw ADC values to screen positions
st7735-lcd-rsDriver for ST7735-based TFT displaysInitializes the display, handles display commands
  1. Rust Embassy Book
  2. Screen connection documentation - explains what each pin of the screen is used for and how to connect them.
  3. Joystick Datasheet
  4. Joystick Documentation - more information about the joystick