Skip to main content
Version: ACS CC

index

Summary

A project about mixing classic 2D games in a single one on Raspberry Pico, having 2048 in the main stage.

info

Author: Nenciu George-Robert
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-robertnen

info

Description

The objective of the project is to show the knowledge gained throughout the semester by making functional hardware that runs games written in Rust. Starting with a 2048 games, it can be very fast changed to Tetris, creating more fun for the player.

Motivation

For many years I loved playing games, even it is not in a computer. While trying to prove what I learn this semester about Rust and hardware, I wanted to show that anyone can create a game on anything that has electricity.

Arhitecture

Architecture

Log

Week 28 April - 4 May

Forked the project and started the documentation. Added the bill of materials and the software most likely used.

Week 5 May - 11 May

Week 12 April - 18 May

Week 19 April - 25 May

Hardware

This project is using the following components:

  • 2x Raspberry Pi Pico 2W for controlling the display and the results intented while pressing the buttons;
  • 1x 1.8" SPI LCD Module (128 x 160) to display the game;
  • 5x push buttons (4 for movements, 1 to change / reset a game).

Schematics

Will be displayed soon.

Bill of materials

NameQuantityUsagePrice
Raspberry Pi Pico 2W2One for debugging (UART), the other for controlling
the architecture
39,66 lei
1.8" SPI LCD Module (128 x 160)1Display for game status, score etc.28,99 lei
Breadboard Jumper Wires Set66Connections between components (picos, buttons,
LCD, etc.)
7,99 lei
0.25 W 10K Ω Resistor10Pull-down resistors for buttons1 leu
2.54 mm Red Pin Headers3Headers for connecting Picos and LCD to the
breadboard
2.97 lei
Breadboard HQ (830 Points)1Main breadboard for connecting the buttons9,98 lei
400p HQ Breadboard1Auxiliary breadboard, likely for GPIO and others4,56 lei
6 x 6 x 6 Push Button84 for movement, 1 for reset / game switch, others
as spares
2,88 lei
Micro USB 1 m Black Cable1Power and programming for a Pico6,95 lei

Software

This is not final. This is most likely what I'll use after I get the last order of components which are missing.

CrateDescriptionUsage
rp2040-halHardware Abstraction Layer for the RP2040 microcontrollerDirect access to GPIOs, UART, SPI, I2C, timers, PWM, etc., on the Pico
embedded-halStandard traits for embedded peripherals (e.g., digital I/O, SPI, I2C)Foundation for cross-platform driver development and HALs
panic-halt (or) defmtpanic-halt: minimal panic handler; defmt: logging and debug outputHandling panics or enabling real-time logging/debugging
embedded-graphics2D graphics primitives for displays (no-std)Drawing shapes, text, images on the LCD
st7735-lcdDriver for ST7735-based SPI displaysCommunicating with and rendering to the 1.8" SPI LCD module
heaplessFixed-capacity data structures with no heap allocationQueues, buffers, or hash maps without dynamic memory
cortex-mLow-level access to ARM Cortex-M processor featuresAccessing special registers, enabling interrupts, etc.
cortex-m-rtRuntime support for Cortex-M processorsDefines the entry point, vector table, and startup code
[usb-device](https://crates.io/crates/usb-device
)USB device stack for embedded systemsCreating USB peripherals (e.g., serial communication over USB)

I got inspiered from the links mentioned below:

  1. 2048
  2. More than just 2048
  3. Tetris