This shows you the differences between two versions of the page.
pm:prj2023:tmiu:gameoflife [2023/05/29 03:43] tea_eliza.tatoiu |
pm:prj2023:tmiu:gameoflife [2023/05/30 18:32] (current) tea_eliza.tatoiu [Concluzii] |
||
---|---|---|---|
Line 8: | Line 8: | ||
</note> | </note> | ||
- | ===== Descriere generală ===== | + | ===== Project Description ===== |
<note tip> | <note tip> | ||
Line 40: | Line 40: | ||
<note tip> | <note tip> | ||
* I am using LedControl.h library | * I am using LedControl.h library | ||
- | * I am implementing the void updateGrid() function and int countNeighbors(int row, int col) | + | * Source code {{:pm:prj2023:tmiu:proiect_game_of_life_care_merge_final.zip|}} |
- | * ...in progress... | + | * void randomize_cells(): gives a random configuration of cells, so the game has a starting point, or if you wanna change the cell configuration mid game; |
+ | * void countAliveNeighbors(int row, int col): counts the number of alive neighbors in the position world[row][col], diagonals also count; | ||
+ | * void next_generation(): figures out the next generation based on the rules i mentioned above, and is using countAliveNeighbors(row,col) and copies the new "world"(of cells) into the current one; | ||
+ | * void showOnLed(): shows on the physical LED, the configuration set on the integer matrix world[8][8] that is filled with ones and zeros | ||
+ | * For the joystick control part : if (joystickX != selectedCellX || joystickY != selectedCellY) - ensures that the selected cell state is updated only when the joystick position changes | ||
+ | *Inside the if condition, I updated the selectedCellX and selectedCellY variables using the map() function. This maps the joystick's analog values (ranging from 0 to 1023) to the corresponding cell coordinates in the world array (ranging from 0 to SIZE-1). | ||
+ | *For changing the state of the selected cell upon joystick click, I added code to check if the joystick click button (JOYSTICK_CLICK_PIN) is pressed and the joystickClicked flag is false. If the conditions are met, the state of the selected cell is toggled by calculating the opposite state using (cellState + 1) % 2. The state of the selected cell in the world array is updated, and the LED at the selected cell position is set to the new state using lc.setLed(). The joystickClicked flag is then set to true. | ||
</note> | </note> | ||
- | ===== Rezultate Obţinute ===== | + | ===== Obtained Results ===== |
<note tip> | <note tip> | ||
- | Care au fost rezultatele obţinute în urma realizării proiectului vostru. | + | {{:pm:prj2023:tmiu:whatsapp_image_2023-05-30_at_16.45.08.jpg?200|}} |
</note> | </note> | ||
===== Concluzii ===== | ===== Concluzii ===== | ||
+ | * Apply what I learned in a practical way. | ||
+ | * Improve problem-solving skills. | ||
+ | * Develop presentation and documentation skills. | ||
===== Download ===== | ===== Download ===== | ||
<note warning> | <note warning> | ||
- | 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:prj2023:tmiu:proiect_game_of_life_care_merge_final.zip|}} |
- | + | ||
- | 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> | </note> | ||
Line 63: | Line 70: | ||
<note tip> | <note tip> | ||
- | Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului. | + | |
</note> | </note> | ||
Line 69: | Line 77: | ||
<note> | <note> | ||
- | Listă cu documente, datasheet-uri, resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. | + | https://www.instructables.com/Arduino-based-Bi-color-LED-Matrix-Game-of-Life/ |
+ | |||
+ | https://steemit.com/utopian-io/@pakganern/how-to-control-8x8-led-matrix-using-joystick | ||
+ | |||
+ | https://forum.arduino.cc/t/help-with-8x8-led-matrix-and-max7219-code-conways-game-of-life-almost-done/131738 | ||
</note> | </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> | ||