index
Summary
A project about mixing classic 2D games in a single one on Raspberry Pico, having 2048 in the main stage.
Author: Nenciu George-Robert
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-robertnen
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
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
Name | Quantity | Usage | Price |
---|---|---|---|
Raspberry Pi Pico 2W | 2 | One for debugging (UART), the other for controlling the architecture | 39,66 lei |
1.8" SPI LCD Module (128 x 160) | 1 | Display for game status, score etc. | 28,99 lei |
Breadboard Jumper Wires Set | 66 | Connections between components (picos, buttons, LCD, etc.) | 7,99 lei |
0.25 W 10K Ω Resistor | 10 | Pull-down resistors for buttons | 1 leu |
2.54 mm Red Pin Headers | 3 | Headers for connecting Picos and LCD to the breadboard | 2.97 lei |
Breadboard HQ (830 Points) | 1 | Main breadboard for connecting the buttons | 9,98 lei |
400p HQ Breadboard | 1 | Auxiliary breadboard, likely for GPIO and others | 4,56 lei |
6 x 6 x 6 Push Button | 8 | 4 for movement, 1 for reset / game switch, others as spares | 2,88 lei |
Micro USB 1 m Black Cable | 1 | Power and programming for a Pico | 6,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.
Crate | Description | Usage |
---|---|---|
rp2040-hal | Hardware Abstraction Layer for the RP2040 microcontroller | Direct access to GPIOs, UART, SPI, I2C, timers, PWM, etc., on the Pico |
embedded-hal | Standard traits for embedded peripherals (e.g., digital I/O, SPI, I2C) | Foundation for cross-platform driver development and HALs |
panic-halt (or) defmt | panic-halt: minimal panic handler; defmt: logging and debug output | Handling panics or enabling real-time logging/debugging |
embedded-graphics | 2D graphics primitives for displays (no-std) | Drawing shapes, text, images on the LCD |
st7735-lcd | Driver for ST7735-based SPI displays | Communicating with and rendering to the 1.8" SPI LCD module |
heapless | Fixed-capacity data structures with no heap allocation | Queues, buffers, or hash maps without dynamic memory |
cortex-m | Low-level access to ARM Cortex-M processor features | Accessing special registers, enabling interrupts, etc. |
cortex-m-rt | Runtime support for Cortex-M processors | Defines the entry point, vector table, and startup code |
[usb-device](https://crates.io/crates/usb-device | ||
) | USB device stack for embedded systems | Creating USB peripherals (e.g., serial communication over USB) |
Links
I got inspiered from the links mentioned below: