A turn based rpg implemeting sensors for various functions on a pico 2w.
Author: Denis-Iulian Pavel
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-denis-iulian-pavel
My project will be a game coded completely in rust designed to run on a Pico 2W with 8 buttons (Left, Right, Up, Down, A, B, C and D), Temp Sensor, Accel Sensor.
I chose this project because I decided to implement a multiple features and utilize all aspects I've studied up until now in the lab, in rust on a microprocessor like the Pico 2W.
Raspberry Pi Pico 2W to:
- RGB_TFT LCD Screen 128x160
- A, B, C, D buttons
- Left, Right and Up, Down buttons
- Buzzer
- Temperature Sensor
- Acceleration Sensor
Established main board connections. Connected debugger, main board, a b c d buttons, screen and buzzer. Wrote code to initialize and test functionality for these. Wrote a script to display chroma keyed sprites on the screen so I can use background images and one to play sounds for the buzzer.
Purchased sensors. Scrapped joystick and replaced with buttons.
Established connections between the rest of the components.

Named the game RogueRust. LithTheFox from the boot screen is my alias.
Chose new sensors, initialized accel sensor but it is unable to read properly
Created main game loop, character sprites, creatures as well as gameplay base off this.
The final board being:

Raspberry Pi Pico 2W, Buttons, Screen (rgb_tft 128x160), Temperature Sensor, Acceleration Sensor.
| Device | Usage | Price |
|---|---|---|
| Raspberry Pi Pico 2W | The main controller | 39.66 RON |
| Electronic Components Kit | Basic Components | 15.63 RON (SALE) |
| 1.8-inch SPI TFT Module LCD Display | Screen | 15.45 RON (SALE) |
| Breadboard HQ (830 Puncte) | Extra Breadboard | 9.98 RON (DELISTED) |
| ADXL345 Digital 3-Axis Accelerometer Module | Various Velocity Interactions | 12.99 RON |
| LM35D Analog Temperature Sensor | Randomization elements | 4.99 RON |
| Total Cost | Full price for the hardware | 98.70 RON |
| Library | Description | Usage |
|---|---|---|
| tinybmp | no_std BMP decoder |
Decode BMP sprite and background images |
| embedded-text | Text layout and rendering on embedded-graphics | Render aligned or wrapped text boxes |
| adxl345_driver2 | Driver for ADXL345 3-axis accelerometer | Read acceleration data for motion or controls |
| itoa | Integer-to-ASCII formatter without pulling in core::fmt |
Fast, heapless number-to-string conversion |
| embassy-executor | Async/await task executor for Cortex-M | Drive embedded async tasks with interrupts or threads |
| embassy-rp | RP2040 HAL integration with async support | Interface Raspberry Pi Pico 2W peripherals asynchronously |
| embassy-time | Timekeeping, delays, and scheduling for embedded async | Sleep, timeouts, and uptime timestamps |
| embassy-usb | Async USB device stack | Implement USB CDC, HID, or custom USB classes |
| embassy-sync | Async-aware synchronization primitives | Share data safely between concurrent async tasks |
| embassy-futures | no_std futures and combinators |
Lightweight future utilities without heap allocation |
| embassy-embedded-hal | Bridges embedded-hal traits into async |
Use HAL traits inside async contexts |
| embedded-graphics | 2D drawing primitives for embedded displays | Draw pixels, shapes, and fonts on TFT or OLED screens |
| display-interface-spi | SPI abstraction for display drivers | Send commands/data to SPI-based screens |
| mipidsi | Generic MIPI-DSI display driver | Drive TFT displays over SPI/MIPI-DSI |
| defmt | Efficient embedded logging framework | Log debug/info messages via RTT or semihosting |
| defmt-rtt | RTT transport layer for defmt |
Transfer log frames over SWO/JTAG via RTT |
| fixed | Fixed-point numeric types | Perform fractional math without floating-point support |
| fixed-macro | Macros for defining fixed-point constants | Write fixed-point literals conveniently |
| static-cell | Statically allocated, runtime-initialized cell | Safely init global data without dynamic allocation |
| heapless | Fixed-capacity data structures (Vec, String, etc.) | Store collections and buffers without alloc |
| embedded-hal-1 | Blocking HAL traits for embedded peripherals | Define SPI, I²C, GPIO, and other blocking interfaces |
| embedded-hal-async | Async variants of embedded-hal traits |
Non-blocking SPI, I²C, UART in async contexts |
| embedded-io-async | Async I/O traits for embedded read/write | Stream/sink traits for sensors and comm interfaces |
| cortex-m-rt | Cortex-M runtime startup and interrupt support | Set up vector tables, entry point, and reset handlers |
| panic-probe | Panic handler that prints backtraces via defmt |
Catch and report panics on embedded targets |
| byte-slice-cast | Safe reinterpretation of byte slices | Cast between &[u8] and &[T] without unsafe code |