Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2025:iivasciuc:marina.oprea2302 [2025/05/20 23:10]
marina.oprea2302 [Implementation details]
pm:prj2025:iivasciuc:marina.oprea2302 [2025/05/21 09:09] (current)
marina.oprea2302 [Results]
Line 139: Line 139:
  
 ---------------------------------------------- ----------------------------------------------
-User can choose to use touchscreen ​or joystick.+User can choose to use __touchscreen__ ​or __joystick__.
  
 In loop function, both variants are polled. Interruptions could not be used because ISR function would have been too complex. Thus I chose polling approach, taking into consideration that playing implies rather continuous moves. In loop function, both variants are polled. Interruptions could not be used because ISR function would have been too complex. Thus I chose polling approach, taking into consideration that playing implies rather continuous moves.
Line 147: Line 147:
     * one that is set the whole time the menu is displayed     * one that is set the whole time the menu is displayed
   * This implements __debouncing__ and also optimizes screen rendering operations.   * This implements __debouncing__ and also optimizes screen rendering operations.
------------+ 
 + 
 + 
 +-------------------------------------------
 -> Information is not displayed ,on every frame'​. Thus, throughout the code I used to display different screens once and maintain them unchanged as much as possible. -> Information is not displayed ,on every frame'​. Thus, throughout the code I used to display different screens once and maintain them unchanged as much as possible.
-------------+-----------------------------------------
 -> SPI protocol is fast, but clearing the whole screen and overwriting all pixels is by far visible with human eye. Thus animations that can be implemented cannot be too fast. -> SPI protocol is fast, but clearing the whole screen and overwriting all pixels is by far visible with human eye. Thus animations that can be implemented cannot be too fast.
  
 ==== Optimizations ==== ==== Optimizations ====
 -> As mentioned above, rerendering is avoided as much as possible. Thus, when screen changes, tile are rendered only if they have different value than before. \\ -> As mentioned above, rerendering is avoided as much as possible. Thus, when screen changes, tile are rendered only if they have different value than before. \\
--> When rendering tiles, color is chosen based on their value. In order to perform this efficiently,​ ILI9341 provided colors are stored in an array and bitwise dividing is used in order to find __idx = log2(val)__. +-> When rendering tiles, color is chosen based on their value. In order to perform this efficiently,​ ILI9341 provided colors are stored in an array and bitwise dividing is used in order to find __idx = log2(val)__. ​\\ 
 +-> ''​EEPROM.update''​ was used instead of ''​EEPROM.write''​ in order to preserve non-volatile memory lifetime.
 ==== Used labs ==== ==== Used labs ====
   * Lab0: GPIO   * Lab0: GPIO
Line 168: Line 171:
 ===== Results ===== ===== Results =====
 [[https://​github.com/​marinaoprea/​2048_Arduino_minigame|GitHub repository]] [[https://​github.com/​marinaoprea/​2048_Arduino_minigame|GitHub repository]]
 +
 +[[https://​drive.google.com/​file/​d/​1MYe3Vqu2S6hLiaHRXt_nY94sQPNRhBG9/​view?​usp=sharing | Demo video]]
  
 {{https://​drive.google.com/​file/​d/​1Xz-yoFstKYTesYOhvp8GsY_ydz1bZbdR/​view?​usp=sharing|Start screen image}} \\  {{https://​drive.google.com/​file/​d/​1Xz-yoFstKYTesYOhvp8GsY_ydz1bZbdR/​view?​usp=sharing|Start screen image}} \\ 
pm/prj2025/iivasciuc/marina.oprea2302.1747771805.txt.gz · Last modified: 2025/05/20 23:10 by marina.oprea2302
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