Close
0%
0%

Snake++

The classic snake game using AVR Atmega32 MCU controlled by Analog Joystick on an LED Matrix Display.

Similar projects worth following
In this project, we built the classic snake game using Atmega32 MCU and a 16x8 LED dot matrix display.

The game starts with a 2-dot snake and the player can control the snake by an analog  joystick. The snake grows by one dot after eating the food and the player's score is incremented by one. A buzzer sounds after the snake eats the food and the speed of the snake also increases. The game continues until the snake eats itself after which the game is over and the player's score and the game highscore is shown. Also the game highscore is retrieved from EEPROM and updated if the the highscore is beaten.

Protocols/Services used in the project:

- SPI for LED Matrix interfacing.

- ADC for Joystick module interfacing

- GPIO for Buzzer

- EEPROM for Game HighScore

Game Algorithm:

- Initialise Snake with two dots. The snake is represented by a 50x2 matrix with each dot represented by the position on the matrix(x,y)

-  The ADC is called and the direction is taken and the snake is moved one dot accordingly.

- If the snake head touches the food pixel, then the snake is grown and a food pixel is drawn randomly on the screen and the loop continues.

- If the snake head touches itself, then the loop breaks and the player's score and highscore is displayed on the screen. The game variables are reset and the loop continues.

GAME VIDEO LINK

snake_game.zip

Extract and run make, then make transfer

Zip Archive - 24.96 kB - 11/29/2017 at 09:56

Download

SCHEMATIC.PNG

SCHEMATIC

Portable Network Graphics (PNG) - 31.39 kB - 11/29/2017 at 09:36

Preview

snake++.pdsprj

PROTEUS 8 SCHEMATIC FILE

pdsprj - 16.26 kB - 11/29/2017 at 09:35

Download

Demo1.MOV

A small demo video of the game.

quicktime - 46.59 MB - 11/09/2017 at 21:49

Download

  • 1 × AVR ATmega32 Microcontroller
  • 1 × 16x8 LED Dot Matrix
  • 1 × JoyStick Module
  • 1 × Buzzer

  • Work Done till 5th November

    Muneeb11/05/2017 at 20:49 0 comments

    Tasks Done:

    - Completed the game logic(Snake.c file)

    - Wrote library to interface atmega32 with two serially connected 8x8 led matrices controlled by MAX2719 drivers (led_control.c file)

    Tasks to do:

    - Make intro and game over tunes with buzzer

    - Load highscore from eeprom

    - Interface accelerometer

  • Work Done till 1st November

    Muneeb11/01/2017 at 12:15 0 comments

    Tasks Completed:

    -  Assembled the MCU with the analog JoyStick modules and the LED Dot Matrix.

    -  Found libraries to interface the LED Matrix (which is controlled by a MAX2719 driver) with the atmega32.

    -  Worked on the basic game loop - wrote function definitions for snake and the board.

    Ongoing tasks:

    -  Working on displaying the player's score on 2 seven segment displays

    -  Working on the game logic - detecting collision and updating scores of player.

View all 2 project logs

Enjoy this project?

Share

Discussions

kuvz15 wrote 09/10/2020 at 13:39 point

Hi guys. I'm an electronic Engineer from Durban and I really love this project. I wanted to try and build something like this. Do you have a Proteus Simulation of this project? If you do, please can you share it. Thank you 

  Are you sure? yes | no

raanayavari wrote 07/03/2018 at 10:08 point

hello

I could not download the PROTEUS file.
And joystick in what kind of library is Proteus, and what name does it have?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates