This shows you the differences between two versions of the page.
pm:prj2022:apredescu:mined_labirinth [2022/05/25 19:00] mihai.mares2010 [Hardware Design] |
pm:prj2022:apredescu:mined_labirinth [2022/05/25 20:59] (current) mihai.mares2010 [Introduction] |
||
---|---|---|---|
Line 5: | Line 5: | ||
===== Introduction ===== | ===== 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 exit, the key and the mines. The player's job will be to navigate through the grid, collect the key and reach the exit without hitting any bombs. | + | 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. | The goal of this project was to get myself used to programming an Arduino microcontroller and also to learn how to solder. | ||
Line 30: | Line 30: | ||
This specific configuration allows the control of the entire matrix using only 7 output pins. | This specific configuration allows the control of the entire matrix using only 7 output pins. | ||
- | I've also built a digital replica of this project on TinkerCad accessible at the link below: | + | ===== Software Design ===== |
- | https://www.tinkercad.com/things/fZJAAXsfZli-swanky-snaget/editel?sharecode=0bbuIXbi3h2ZAVldh3UEmUbhqDcp3eWFfsQdjW7n0CM | + | The code was written in Sublime Text 3 and compiled/uploaded to the Adruino using Arduino IDE |
- | ===== Software Design ===== | + | 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. | ||
- | <note tip> | ||
- | Descrierea codului aplicaţiei (firmware): | ||
- | * mediu de dezvoltare (if any) (e.g. AVR Studio, CodeVisionAVR) | ||
- | * librării şi surse 3rd-party (e.g. Procyon AVRlib) | ||
- | * algoritmi şi structuri pe care plănuiţi să le implementaţi | ||
- | * (etapa 3) surse şi funcţii implementate | ||
- | </note> | ||
- | ===== Rezultate Obţinute ===== | + | ===== Results ===== |
- | <note tip> | + | Below are a couple images showing the results. Each of the hanging cables are connected to the Arduino board when the project is assembled.\\ |
- | Care au fost rezultatele obţinute în urma realizării proiectului vostru. | + | {{:pm:prj2022:apredescu:pm_1.png?200 |}} |
- | </note> | + | {{:pm:prj2022:apredescu:pm_2.png?200 |}} |
+ | {{:pm:prj2022:apredescu:pm_3.png?200 |}} | ||
- | ===== Concluzii ===== | + | ===== 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 ===== | ===== Download ===== | ||
- | <note warning> | + | In the archive below are the .ino file containing the code used for this project as well as the images above. |
- | O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului: surse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-). | + | {{:pm:prj2022:apredescu:mares_mihai_1221a_pmproject.rar|}} |
- | Fişierele se încarcă pe wiki folosind facilitatea **Add Images or other files**. Namespace-ul în care se încarcă fişierele este de tipul **:pm:prj20??:c?** sau **:pm:prj20??:c?:nume_student** (dacă este cazul). **Exemplu:** Dumitru Alin, 331CC -> **:pm:prj2009:cc:dumitru_alin**. | ||
- | </note> | ||
- | ===== Jurnal ===== | + | ===== Bibliografie/Resurse ===== |
- | <note tip> | + | More documentation on charlieplexing. \\ |
- | Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului. | + | https://en.wikipedia.org/wiki/Charlieplexing \\ |
- | </note> | + | |
- | ===== Bibliografie/Resurse ===== | + | 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 | |
- | <note> | + | |
- | Listă cu documente, datasheet-uri, resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. | + | |
- | </note> | + | |
<html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | ||