/TetrisGameArduino

8x8 LED matrix game

Primary LanguageC

TetrisGameArduino

Introduction to Robotics project #1: LED matrix 8x8 game

Backstory

image I am Mădălin Frîncu, a CS student at Unibuc and this repository showcases my project in Arduino: a fully operating Tetris game. I have picked this game not because it's just retro but because I have a current passion for this game and I love playing Tetris with my 3D glasses for the great experience it can offer for keen minds.

Showcase

Main Menu

image

Contrast settings

image

Tetris gameplay

image


Components

  • Arduino UNO
  • 16x2 LCD Display
  • 8x8 LED Matrix
  • Joystick
  • Breadboards
  • Wires
  • Electrolytic capacitor
  • Ceramic capacitor
  • Resistors
  • 2 Buttons: Pause Button & Enter Button

Video on YouTube

youtube link

Code architecture

The following source code files are used in the project.

File Description
game.h Defines game variables and game logic in a few functions
myLedControl.h A copy of LedControl.h for improving speed in digitalRead() and digitalWrite() operations
myLiquidCrystal.h A copy of LiquidCrystal.h for improving speed in digitalRead() and digitalWrite() operations
registerIO.h File containing functions for digital I/O on Arduino pins using registers
main_menu.h File defining main menu functionalities
project.ino Has the loop() and setup() functions for main program
song.h Defines a short Tetris theme song and it's used on startUp and on changeName
utils.h Defines essential variables and utility functions used by other files
Much more code comments to be found in source code ezgif com-gif-maker

Call graph on handleMenu() from main_menu.h called in main program. It's made by Doxygen using dot tool from Graphviz package

image