Skip to main content
Version: ACS CC

Snake Game

A joystick controlled snake on a display using a Arduino Uno R3 board

info

Author: Plai George Alexandru
GitHub Project Link: link_to_github

Description

A way to play the famous game "Snake".The game is displayed on a MAX7219 display and controlled using a josytick all of it being connected to a ARDUINO UNO R3.

Motivation

The idea came from a trip to my grandma's where her old phone had the famous game called snake. Playing it again after such a long while made me relieve my childhood memories and thus decided to choose this game for the project.

Architecture

The Arduino Uno R3 is the board chosen for this project acting as the main component to which every other peripheral is connected Breadboard handles some of the peripherals ports such as VCC and GND MAX7219 Display and the Joystick are connected to bot the breadboard and the Arduino Uno R3 based on the needed port.

block

Log

Week 5 - 11 May

Ordering parts & research

Week 12 - 18 May

Assembly

Week 19 - 25 May

Testing

Hardware

Arduino Uno R3 MAX7219 8x8 Display Joystick Green LED Breadboard Port to Socket wire Socket to Socket wire

Schematics

block

Bill of Materials

DeviceUsagePrice
Joystick doua axe XY (402)Direction Input1x 3.99RON (https://sigmanortec.ro/Modul-joystick-doua-axe-XY-p126458908)
[Matrice led 8x8, MAX7219, 5V (956)] (https://www.analog.com/media/en/technical-documentation/data-sheets/max7219-max7221.pdf)Displaying the game(https://sigmanortec.ro/modul-matrice-led-8x8-max7219-5v) - 1x 11.98 RON
Breadboard 400 puncte (56)Connecting ports to sockets(https://sigmanortec.ro/Breadboard-400-puncte-p129872825) - 1x 6.37 RON
[Placa dezvoltare UNO R3 Arduino Compatibil, ATmega328p, CH340G, cu bara pini (535)] (https://docs.arduino.cc/resources/datasheets/A000066-datasheet.pdf)Central board and Debugger(https://sigmanortec.ro/Placa-dezvoltare-UNO-R3-Arduino-Compatibil-ATmega328p-CH340G-cu-bara-pini-p170362384) - 1x 30.42 RON
[40 Fire Dupont 30cm, Tata-Mama (8)] (https://www.farnell.com/datasheets/3178883.pdf)Used for connecting the ports of peripherals to Breadboard or Board(https://sigmanortec.ro/40-Fire-Dupont-30cm-Tata-Mama-p210854349) - 1x 7.94 RON
[LED 5mm, Verde (1931)] (https://www.scribd.com/document/782240493/Green-LED-datasheet)Used as a initial signal to check the Board(https://sigmanortec.ro/led-5mm-verde) - 1x 0.30 RON
[40 Fire Dupont 30cm, Tata-Tata (9)] (https://www.farnell.com/datasheets/3178883.pdf)Used to connect Board to Breadboard(https://sigmanortec.ro/40-Fire-Dupont-30cm-Tata-Tata-p210849599) - 1x 7.94 RON
Total : 83.84RON

Software

LibraryDescriptionUsage
Arduino-HalHAL (hardware abstraction layer) for Arduino boardsUsed for analog to digital conversion,taking control of peripherals
Max7219Drivers for the MAX7219 DisplayUsed to control the Display,send pixel data to the physical display,setting brightness
MAX7219_canvasProvides a higher level of abstraction for drawing onto the displayUsed for representing different elements(snake,fruits),updating the displaycanvas with canvaslayer information.
randlibrary for random number generationUsed for generating numbers that act as place for the fruits to be placed at
const_randomgenerates random values at compile timeUsed for generating a seed so each game start randomly from the last one
  1. link
  2. link
  3. link
  4. link
  5. link ...