Difference between revisions of "F24: Survival Dodge"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Schedule)
(Acknowledgement)
 
(16 intermediate revisions by the same user not shown)
Line 18: Line 18:
  
 
== Objectives & Introduction ==
 
== Objectives & Introduction ==
Show list of your objectives. This section includes the high level details of your project.  You can write about the various sensors or peripherals you used to get your project completed.
+
"Survival Dodge" aims to create an engaging game where players maneuver a character to avoid obstacles and accumulate points, displayed on an LED matrix. As players progress, the game increases in difficulty by accelerating the obstacles, testing reflexes and enhancing engagement through simple button-based controls.
  
 
=== Team Members & Responsibilities ===
 
=== Team Members & Responsibilities ===
Line 29: Line 29:
  
 
== Schedule ==
 
== Schedule ==
 
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! scope="col"| Week#
 
! scope="col"| Week#
! scope="col"| Date
+
! scope="col"| Start Date
 +
! scope="col"| End Date
 
! scope="col"| Task
 
! scope="col"| Task
 
! scope="col"| Status
 
! scope="col"| Status
 
|-
 
|-
 
! scope="row"| 1
 
! scope="row"| 1
| 10/14
+
|  
 +
* 10/21/2024
 +
|
 +
* 10/28/2024
 
|
 
|
* To go through previous projects and discuss with the team members :  http://socialledge.com/sjsu/index.php/Realtime_OS_on_Embedded_Systems
+
* Read previous projects, gather information and discuss among the group members.
* To come up with new ideas for applications specific to FreeRTOS.  
+
* Create GitLab repository for project
 +
* Discuss and source parts for project. Start ordering parts.
 
|  
 
|  
* After a brainstorming session with the team, we decided to work on gaming projects using FreeRTOS.
+
* <span style="color:green">Completed</span>
* Created Git lab link to the project : https://gitlab.com/cmpe-240-advanced-computer-design/survival-dodge-group-8
 
* Prepared the abstract for the project proposal.
 
 
|-
 
|-
 
! scope="row"| 2
 
! scope="row"| 2
| 10/21
 
 
|  
 
|  
* To assign roles and responsibilities to each team member.
+
*10/29/2024 
* To decide the structure of the team and divide the project into different modules.
 
* To finalize the deadlines and deliverables for the project.
 
 
|  
 
|  
* Assigned roles and responsibilities to each member.
+
*11/04/2024
* Created a test plan with tasks, deadlines and deliverables assigned to it.
+
|
 +
 
 +
* Order necessary parts
 +
* Discuss and break down project into potential components to divide up work
 +
* Familiarize with relevant hardware datasheets
 +
|
 +
* <span style="color:green">Completed</span>
 
|-
 
|-
 
! scope="row"| 3
 
! scope="row"| 3
| 10/28
+
|
|  
+
*11/05/2024
* To start designing the Master module which will take inputs from different players, take a decision and sends it to LED Matrix display.
+
|
|  
+
*11/11/2024
* Divided the project into different modules like Master, Player, Wireless, LED Display, PCB, and Testing.
+
|
* Started designing the Master module to take inputs from Players.
+
* Order any missing parts we may need
 +
* Develop drivers for hardware required in the project
 +
* Develop driver for LED display.
 +
|
 +
* <span style="color:green">Completed</span>
 +
 
 +
 
 
|-
 
|-
 
! scope="row"| 4
 
! scope="row"| 4
| 11/04
+
|
|  
+
* 11/12/2024
* To understand the high-level APIs for the Wireless nordic node.
+
|
* To understand the connections, read the datasheet for RGB LED Matrix.
+
* 11/18/2024
|
+
|
* Made a basic layout, pin connections, power requirements for 64x64 RGB LED Matrix.
+
* Continue developing drivers.
* Understood the Wireless APIs available and wrote a basic code to send-receive data using Nordic.
+
* Search and finalize game sounds.
 +
* Start testing drivers on hardware
 +
* Discuss and plan game logic
 +
|
 +
* <span style="color:green">Completed</span>
 
|-
 
|-
 
! scope="row"| 5
 
! scope="row"| 5
| 11/11
+
|
|  
+
*11/19/2024
* To install Eagle software for PCB design and get accustomed to the basic functions.
+
|
|  
+
*11/25/2024
 
+
|
 +
* Finalize wiki schedule.
 +
* Order circuit boards components and complete the design for printing
 +
* Complete drivers for MP3 decoder.
 +
* Circuit board testing.
 +
* Additional accessories if required and finalization of hardware
 +
* Start developing game logic
 +
|
 +
* <span style="color:green">Completed</span>
 
|-
 
|-
 
! scope="row"| 6
 
! scope="row"| 6
| 11/18
 
 
|
 
|
* To test the Player and Master modules.
+
*11/26/2024
* To understand addressing mode, latching, and clock functionality for RGB LED Matrix.
 
 
|  
 
|  
 +
*12/02/2024
 +
|
 +
* Integration of circuit boards, different components, and microcontroller
 +
* Continue game logic development
 +
* Testing and debugging the game logic
 +
|
 +
* <span style="color:green">Completed</span>
  
 
|-
 
|-
 
! scope="row"| 7
 
! scope="row"| 7
| 11/25
+
|  
 +
* 12/03/2022
 +
 
 +
|
 +
* 12/09/2022
 +
|
 +
* Integrate game logic code with LED matrix
 +
* Integrate game sounds with game logic
 
|
 
|
 
+
* <span style="color:green">Completed</span>
 +
* <span style="color:green">Completed</span>
 
|-
 
|-
 
! scope="row"| 8
 
! scope="row"| 8
| 12/02
 
 
|  
 
|  
* To send and receive data between Player and Master using Wireless protocol.
+
* 12/04/2022
* To write the logic to glow a particular LED on the display matrix.
+
|
* To design and finalize the PCB circuit.
+
* 12/09/2022
 +
|
 +
 
 +
* Integrate subsystem.
 +
* Finalizing the video game.
 +
* Update the wiki page.
 
|
 
|
 +
* <span style="color:green">Completed</span>
  
 
|-
 
|-
 
! scope="row"| 9
 
! scope="row"| 9
| 12/09
 
 
|  
 
|  
* To implement RGB LED Matrix tasks and APIs for the Master module.
+
* 12/10/2022
* To integrate the layout of the application (UI, border, car design, obstacle design) to Master Module.
+
|
* To generate random obstacles, score logic and implement other game functionalities (eg: game over scenario).
+
* 12/19/2022
* To display the cars, border area, screen division for 2 cars and enable obstacle and car movement as per the input from the master module.
+
|
* Finalize the PCB design, get it reviewed by the team and send it for fabrication.
+
* Address bugs during testing of integrated system
 +
* Test pause/play functionality
 
|
 
|
 
+
* <span style="color:green">Completed</span>
 
|-
 
|-
 
! scope="row"| 10
 
! scope="row"| 10
| 12/16
 
 
|  
 
|  
* To keep moving the display down continuously for the car race track.
+
*12/19/2024
* To move the car horizontally pixel by pixel for every change in data from the player module.
+
*12/19/2024
* To test the overall functionality of the project using PCB.
+
*12/19/2024
 +
*12/19/2024
 +
|
 +
*12/19/2024
 +
*12/19/2024
 +
*12/19/2024
 +
*12/19/2024
 +
|
 +
 
 +
*Final Demo
 +
*Update Gitlab repo with final code.
 +
*Update test video.
 +
*Update the wiki page.
 
|
 
|
 +
* <span style="color:orange">Pending</span>
 +
* <span style="color:orange">Pending</span>
 +
* <span style="color:orange">Pending</span>
 +
* <span style="color:orange">Pending</span>
 +
|-
 +
|}
 +
 +
== Parts List & Cost ==
  
 +
{| class="wikitable"
 +
|-
 +
! scope="col"| Item#
 +
! scope="col"| Description
 +
! scope="col"| Quantity
 +
! scope="col"| Price
 
|-
 
|-
! scope="row"| 11
+
! scope="row"| 1
| 05/13
+
|  
 +
SJ2C Board
 +
|
 +
1
 
|  
 
|  
* To Integration of all modules and end to end testing.
+
$50.00
* To fix bugs and optimize the code.
+
|-
 +
! scope="row"| 2
 +
|
 +
LED Display
 +
|
 +
1
 +
|
 +
$70.49
 +
|-
 +
! scope="row"| 3
 +
|
 +
Momentary switches
 +
|
 +
5
 
|
 
|
 +
$8.99
 +
|-
 +
! scope="row"| 4
 +
|
 +
Jumper wires
 +
|
 +
Pack
 +
|
 +
$8.99
 +
|-
 +
! scope="row"| 5
 +
|
 +
MP3 serial module
 +
|
 +
1
 +
|
 +
$ 8.39
 +
|-
 +
|}
 +
 +
== Design & Implementation ==
 +
 +
'''LED Matrix Display:'''
 +
 +
The 64 x 64 LED matrix comprises 4,096 pixels, each equipped with three channels for the colors red, green, and blue. The matrix uses a 5:32 decoder to address every two rows simultaneously, resulting in two distinct sections: the upper half includes rows 0 to 31, and the lower half consists of rows 32 to 64. To activate each LED, the corresponding RGB pins must be set to HIGH and fed into a 64-bit shift register that aligns with the matrix's 64 columns. The upper half of the display is managed by the RGB pins labeled R1, G1, and B1, while the lower half is controlled by R2, G2, and B2.
 +
 +
{|
 +
|[[File:LED Matrix.jpg|550px|left|thumb|LED Matrix]]
 +
|
 +
|
 +
|[[File:LED Backpanel.jpg|400px|left|thumb|LED Backpanel]]
 +
|
 +
|}
 +
  
 +
The figure and table below shows the pin-out of RGB LED matrix with description.
 +
[[File:Panel.png | 450px | thumb | left| '''For Interface of RGB LED matrix with LPC''']]
 +
{| class="wikitable"
 +
|-
 +
! scope="col"| Label
 +
! scope="col"| Name
 +
! scope="col"| Function
 +
|-
 +
! scope="row"| 1
 +
| R1
 +
| High R data
 +
|-
 +
! scope="row"| 2
 +
| G1
 +
| High G data
 +
|-
 +
! scope="row"| 3
 +
| B1
 +
| High B data
 +
|-
 +
! scope="row"| 4
 +
| R2
 +
| Low R data
 
|-
 
|-
 +
! scope="row"| 5
 +
| G2
 +
| Low G data
 +
|-
 +
! scope="row"| 6
 +
| B2
 +
| Low B data
 +
|-
 +
! scope="row"| 7
 +
| A
 +
| A line selection
 +
|-
 +
! scope="row"| 8
 +
| B
 +
| B line selection
 +
|-
 +
! scope="row"| 9
 +
| C
 +
| C line selection
 +
|-
 +
! scope="row"| 10
 +
| D
 +
| D line selection
 +
|-
 +
 +
! scope="row"| 11
 +
| CLK
 +
| CLOCK
 
|-
 
|-
 
! scope="row"| 12
 
! scope="row"| 12
| 05/20
+
| LAT
|  
+
| LATCH
* Adding extra functionalities and extra features for the project.
+
|-
* Test the extra features with overall project requirement.
+
! scope="row"| 13
|
+
| OE
 +
| Output Enable
 +
|-
 +
! scope="row"| 14
 +
| GND
 +
| GND
 +
|}
 +
 
 +
 
 +
'''Momentary Press Buttons'''
 +
 
 +
We utilized Weideer 16mm Push buttons sourced from Amazon for user input. These buttons offered a tactile response and a specific degree of switch travel, with each button featuring two terminals. We wired one terminal of each button to three distinct GPIO pins on the SJ2 Board for input signal reception. The other terminal was connected to the 3.3V Vcc of the SJ2. To avoid any floating inputs when the buttons were not active, we activated pull-down resistors in the software for these switches.
 +
 
 +
[[File:weideer_buttons.jpg|300x300px|thumb|center|Weideer 16mm Momentary Push Buttons]]
 +
 
  
|}
 
  
== Parts List & Cost ==
 
Give a simple list of the cost of your project broken down by components.  Do not write long stories here.
 
  
== Design & Implementation ==
 
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.
 
  
 
=== Hardware Design ===
 
=== Hardware Design ===
Line 158: Line 333:
  
 
=== Implementation ===
 
=== Implementation ===
This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.
+
 
 +
== '''Game Logic''' ==
 +
 
 +
=== Game States ===
 +
*1. Start Up
 +
*2. Game Running
 +
*3. Game Over
 +
 
 +
=== Player Task===
 +
Game state: start up
 +
*1. Display start up screen once per starting
 +
*2. Reset game parameters
 +
 
 +
Game state: game running
 +
*1. Display player and health bar on screen
 +
*2. Capture and move player location by switch signals
 +
*3. Check health and switch to game over state when player's health reaches zero
 +
*4. Check collision
 +
 
 +
Game state: game over
 +
*1. Display game over screen
  
 
== Testing & Technical Challenges ==
 
== Testing & Technical Challenges ==
Line 170: Line 365:
  
 
== Conclusion ==
 
== Conclusion ==
Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?
+
Developing "Survival Dodge" was a highly engaging and stimulating experience that kept us constantly intrigued. Tackling the various technical challenges, particularly in adjusting the game dynamics and LED matrix display, enhanced our practical problem-solving skills. Through this project, we applied key concepts from our game design and software engineering coursework, gaining deeper insights into real-time system management and user interface design. Collaborating on this project not only honed our teamwork and time management skills but also boosted our confidence in handling complex embedded systems and preparing for technical interviews.
  
 
=== Project Video ===
 
=== Project Video ===
Line 176: Line 371:
  
 
=== Project Source Code ===
 
=== Project Source Code ===
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]
+
https://gitlab.com/chandrasekhar2499/sjtwo-c/-/tree/test?ref_type=heads
  
 
== References ==
 
== References ==
 
=== Acknowledgement ===
 
=== Acknowledgement ===
Any acknowledgement that you may wish to provide can be included here.
+
We would like to sincerely thank Professor Preetpal Kang for his all-round guidance, feedback, and support. His classroom lectures were significant in imparting knowledge on Advanced Computer Design.
  
 
=== References Used ===
 
=== References Used ===

Latest revision as of 00:34, 20 December 2024

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Project Title

Survival Dodge

Abstract

Survival Dodge is a classic arcade-style game focused on quick reflexes and survival, reminiscent of retro gaming experiences. This project aims to recreate the intense and fast-paced gameplay using the SJ-2 board and an LED matrix display. In this game, players control a character (or an object) that must dodge incoming obstacles from multiple directions, with the speed and frequency of obstacles increasing over time. The objective is to survive as long as possible, setting high scores based on survival time. Players will use buttons or a joystick to maneuver, with core implementation focusing on responsive controls, real-time collision detection, and adaptive difficulty for sustained challenge.

Objectives & Introduction

"Survival Dodge" aims to create an engaging game where players maneuver a character to avoid obstacles and accumulate points, displayed on an LED matrix. As players progress, the game increases in difficulty by accelerating the obstacles, testing reflexes and enhancing engagement through simple button-based controls.

Team Members & Responsibilities

  • Uday Kumar Reddy Pesala
  • Chandra Sekhar Naidu Gorle
  • Adi Siva Prasad Reddy Korivi

Schedule

Week# Start Date End Date Task Status
1
  • 10/21/2024
  • 10/28/2024
  • Read previous projects, gather information and discuss among the group members.
  • Create GitLab repository for project
  • Discuss and source parts for project. Start ordering parts.
  • Completed
2
  • 10/29/2024
  • 11/04/2024
  • Order necessary parts
  • Discuss and break down project into potential components to divide up work
  • Familiarize with relevant hardware datasheets
  • Completed
3
  • 11/05/2024
  • 11/11/2024
  • Order any missing parts we may need
  • Develop drivers for hardware required in the project
  • Develop driver for LED display.
  • Completed


4
  • 11/12/2024
  • 11/18/2024
  • Continue developing drivers.
  • Search and finalize game sounds.
  • Start testing drivers on hardware
  • Discuss and plan game logic
  • Completed
5
  • 11/19/2024
  • 11/25/2024
  • Finalize wiki schedule.
  • Order circuit boards components and complete the design for printing
  • Complete drivers for MP3 decoder.
  • Circuit board testing.
  • Additional accessories if required and finalization of hardware
  • Start developing game logic
  • Completed
6
  • 11/26/2024
  • 12/02/2024
  • Integration of circuit boards, different components, and microcontroller
  • Continue game logic development
  • Testing and debugging the game logic
  • Completed
7
  • 12/03/2022
  • 12/09/2022
  • Integrate game logic code with LED matrix
  • Integrate game sounds with game logic
  • Completed
  • Completed
8
  • 12/04/2022
  • 12/09/2022
  • Integrate subsystem.
  • Finalizing the video game.
  • Update the wiki page.
  • Completed
9
  • 12/10/2022
  • 12/19/2022
  • Address bugs during testing of integrated system
  • Test pause/play functionality
  • Completed
10
  • 12/19/2024
  • 12/19/2024
  • 12/19/2024
  • 12/19/2024
  • 12/19/2024
  • 12/19/2024
  • 12/19/2024
  • 12/19/2024
  • Final Demo
  • Update Gitlab repo with final code.
  • Update test video.
  • Update the wiki page.
  • Pending
  • Pending
  • Pending
  • Pending

Parts List & Cost

Item# Description Quantity Price
1

SJ2C Board

1

$50.00

2

LED Display

1

$70.49

3

Momentary switches

5

$8.99

4

Jumper wires

Pack

$8.99

5

MP3 serial module

1

$ 8.39

Design & Implementation

LED Matrix Display:

The 64 x 64 LED matrix comprises 4,096 pixels, each equipped with three channels for the colors red, green, and blue. The matrix uses a 5:32 decoder to address every two rows simultaneously, resulting in two distinct sections: the upper half includes rows 0 to 31, and the lower half consists of rows 32 to 64. To activate each LED, the corresponding RGB pins must be set to HIGH and fed into a 64-bit shift register that aligns with the matrix's 64 columns. The upper half of the display is managed by the RGB pins labeled R1, G1, and B1, while the lower half is controlled by R2, G2, and B2.

LED Matrix
LED Backpanel


The figure and table below shows the pin-out of RGB LED matrix with description.

For Interface of RGB LED matrix with LPC
Label Name Function
1 R1 High R data
2 G1 High G data
3 B1 High B data
4 R2 Low R data
5 G2 Low G data
6 B2 Low B data
7 A A line selection
8 B B line selection
9 C C line selection
10 D D line selection
11 CLK CLOCK
12 LAT LATCH
13 OE Output Enable
14 GND GND


Momentary Press Buttons

We utilized Weideer 16mm Push buttons sourced from Amazon for user input. These buttons offered a tactile response and a specific degree of switch travel, with each button featuring two terminals. We wired one terminal of each button to three distinct GPIO pins on the SJ2 Board for input signal reception. The other terminal was connected to the 3.3V Vcc of the SJ2. To avoid any floating inputs when the buttons were not active, we activated pull-down resistors in the software for these switches.

Weideer 16mm Momentary Push Buttons



Hardware Design

Discuss your hardware design here. Show detailed schematics, and the interface here.

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.

Software Design

Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.

Implementation

Game Logic

Game States

  • 1. Start Up
  • 2. Game Running
  • 3. Game Over

Player Task

Game state: start up

  • 1. Display start up screen once per starting
  • 2. Reset game parameters

Game state: game running

  • 1. Display player and health bar on screen
  • 2. Capture and move player location by switch signals
  • 3. Check health and switch to game over state when player's health reaches zero
  • 4. Check collision

Game state: game over

  • 1. Display game over screen

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

<Bug/issue name>

Discuss the issue and resolution.

Conclusion

Developing "Survival Dodge" was a highly engaging and stimulating experience that kept us constantly intrigued. Tackling the various technical challenges, particularly in adjusting the game dynamics and LED matrix display, enhanced our practical problem-solving skills. Through this project, we applied key concepts from our game design and software engineering coursework, gaining deeper insights into real-time system management and user interface design. Collaborating on this project not only honed our teamwork and time management skills but also boosted our confidence in handling complex embedded systems and preparing for technical interviews.

Project Video

Upload a video of your project and post the link here.

Project Source Code

https://gitlab.com/chandrasekhar2499/sjtwo-c/-/tree/test?ref_type=heads

References

Acknowledgement

We would like to sincerely thank Professor Preetpal Kang for his all-round guidance, feedback, and support. His classroom lectures were significant in imparting knowledge on Advanced Computer Design.

References Used

List any references used in project.

Appendix

You can list the references you used.