Mined Labirinth

Author: Mihai-Alexandru Mares
Group: 1221A
Faculty: FILS

Introduction

The game is played on a grid made of LEDs. At the start of the game, some LEDs will blink, indicating the positions of the mines. The player's job will be to navigate through the grid and reach the exit which will be on the oposite corner, without hitting any bombs.

The goal of this project was to get myself used to programming an Arduino microcontroller and also to learn how to solder.

General Description


Input:

  • Joystick which consists of 4 buttons (up; down; left; right)

Output:

  • 6×6 LED matrix
  • Buzzer

Hardware Design

List of components:

  • Arduino Leonardo
  • LEDS for the matrix (x36)
  • Buttons (x4)
  • Buzzer
  • Jumper Cables

Schematic for how the LED matrix is wired together:

This specific configuration allows the control of the entire matrix using only 7 output pins.

Software Design

The code was written in Sublime Text 3 and compiled/uploaded to the Adruino using Arduino IDE

The main loop of the game is:

  • Showing the player where the bombs are.
  • Waiting for input from the joystick (the buttons are connected to analog input pins)
  • Moving in the corresponding direction.
  • Checking if any bombs were hit.
    • Reset if a bomb was hit.
  • Checking if the exit has been reached.
    • Reset if the exit has been reached.

I used the “Charlieplexing” algorithm to control which specific LED lights up. It works by setting the 2 output pins corresponding to the desired LED to OUTPUT (one to HIGH and one to LOW) and all the other ones to INPUT.

Results

Below are a couple images showing the results. Each of the hanging cables are connected to the Arduino board when the project is assembled.

Conclusions

This project has been a great learning experience and very interesting to do despite the fact that I didn't get to implement all of the features I initially planned for it.

Download

In the archive below are the .ino file containing the code used for this project as well as the images above. mares_mihai_1221a_pmproject.rar

Bibliografie/Resurse

More documentation on charlieplexing.
https://en.wikipedia.org/wiki/Charlieplexing

I've also built a digital replica of this project on TinkerCad accessible at the link below:
https://www.tinkercad.com/things/fZJAAXsfZli-swanky-snaget/editel?sharecode=0bbuIXbi3h2ZAVldh3UEmUbhqDcp3eWFfsQdjW7n0CM

Export to PDF

pm/prj2022/apredescu/mined_labirinth.txt · Last modified: 2022/05/25 20:59 by mihai.mares2010
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0