Skip to main content

Pico Snake Game

A game in rust that resembles the classic Snake Game from the Nokia 5110 phones era.

info

Author: Mihai-Septimiu Tigaeru
GitHub Project Link: https://github.com/UPB-FILS-MA/project-septimium

Description

This projects resembles the classic Snake Game from the old Nokia phones, having the same rules and mechanics. You control the Snake using a 2-axis joystick. Your score is updated live on a 4 digit display, that goes until 9999. For every interaction with "food", there is a buzzer which will play a sound. If you hit yourself, it's game over and you have to start again. You can also pass through walls. The game itself is displayed on an actual Nokia 5110 LCD display. Good luck and enjoy!

Motivation

I've chosen this project mainly because I've always wanted to create a fully functional game from zero, including hardware and I've always liked the idea of retro-themed stuff. Also, by looking on the internet and finding out that there's actual Nokia displays that can be easily used with microcontrollers I've instantly thought about one of the most popular Nokia games, Snake, and how cool it would be to recreate it using Rust.

Architecture

architecture

Log

Week 6 - 12 May

  • Created the documentation of the project
  • Added KiCAD Schematic
  • Added 3 new libraries

Week 13 - 19 May

  • Modified KiCAD Schematic
  • Modified a library
  • Managed to configure all the components of the project in Rust
  • Finished Hardware
  • Designed the aspect of the project

Week 20 - 26 May

  • Modified new libraries needed for this project
  • Finished Software
  • Took new hardware pictures with working game
  • Updated the final documentation
  • Finished the whole project

Hardware

Pictures

opened

game

gameover

sprofile

Usage of components

  • Joystick Module is used for controlling the snake (interacting with the game) and it's connected to ADC pins such that the analog voltage is converted to digital values.
  • Passive Buzzer is used for beeping in various situations (sound feedback from the game).
  • Nokia 5110 Display is used for displaying the game itself.
  • TM1637 Module is used for keeping track of the score while playing.
  • Raspberry Pi Pico H is used as the main component (microcontroller) responsible for processing input data.
  • Breadboard is used for connecting every pin of the hardware components.

Schematics

kicadschematic

Bill of Materials

DeviceUsagePrice
Rapspberry Pi Pico HThe microcontroller40 RON
2-axis (XY) Joystick ModuleGame Interactions6 RON
Breadboard 400Hardware Pins Connections9 RON
Pasive Buzzer ModuleSounds4 RON
LCD Nokia 5110 Display 84x48Game Displaying24 RON
LED Display Module with Serial Interface (TM1637)Score Counting11 RON
Dupont Wires M-MConnections7 RON
Dupont Wires F-FConnections6 RON
Dupont Wires M-FConnections6 RON
Jumper Wires KitConnections9 RON
Micro USB CablePower8 RON

Software

LibraryDescriptionUsage
embassyRust framework for embedded programmingUsed for writing correct, safe and asynchronous code, particularly targeted at embedded systems
pcd8544 (modified)Rust crate for PCD8544 displays forked and modified so it is compatible with embedded-graphicsUsed for initiliazing and writing on the PCD8544 display
tm1637-embedded-halRust crate for TM1637 microcontrollerUsed for controlling the TM1637 module
embedded-snake (modified)Rust crate for Snake Game mechanics forked and modified so it has more functionsUsed for implementation of the proper Snake Game
randRust crate for random number generatingUsed for creating a random position for the "food"
embedded-graphicsRust crate for drawing graphics on small displaysUsed for displaying the game
  1. Arduino Snake Game Project
  2. Nokia5110 LCD interfacing with Raspberry Pi Pico using SPI
  3. Snake Game with Rust