F21: Flame Over

From Embedded Systems Learning Academy
Revision as of 18:51, 16 December 2021 by Proj user4 (talk | contribs) (PIN CONFIGURATION)

Jump to: navigation, search

Abstract

Flame Over is a single-player mode game where the player moves a fire fighter to destroy the fire flames that come shooting at the player using a water gun. The player is granted four lives at the start of the game at each level. The Player’s lives will decrease by one for every three flames that touch the fire fighter. The player transits to the next level when enough flames are destroyed at each level. The speed of the flames approaching the fire fighter varies between levels.

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.

Objectives

  • Write driver module to display game characters and update the display continuously at an optimum refresh rate
  • Implement game algorithm for movement of player and flames in real-time, generate water splash bullets.
  • Implement player lives count, player health and collision algorithms.
  • Write driver module to receive directions from the input device (joystick) via zigbee.
  • Fetch Joystick data over ADC and transmit the joystick signals wirelessly via Zigbee with the help of UART drivers.
  • Write driver module to play game sounds via MP3 encoder
  • Use FreeRTOS tasks and understand task priority and synchronization.


Team Members & Responsibilities

  • Naveena Sura
    • Game logic and design
    • Game implementation
    • Built game characters on LED matrix display
    • Game Animation Screens
    • Bug fixes and optimizations
  • Suganya Nandakumar
    • GPIO Driver for LED matrix display
    • Built game characters on LED matrix display
    • PCB Schematic and Board Design
    • Soldering all components on PCB
  • Vaidehi Deshpande
    • Joystick Interfacing - ADC driver
    • Speaker and MP3 Decoder interfacing
    • Zigbee interfacing with UART driver for transmission and reception
    • Built game characters on LED matrix display

Schedule

Week# Start Date End Date Task Status
1
  • 10/15/2021
  • 10/22/2021
  • Read previous projects, gather information.
  • Discussion on RGB LED matrix and Audio Decoder.
  • Gathering information regarding Bluetooth module and Joystick interface.
  • Finalize part list
  • Decide and distribute major roles among team members
  • Decide and re-phrase the game rules
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
2
  • 10/23/2021
  • 11/04/2021
  • Order necessary parts
  • Plan first draft of Wiki schedule
  • Review RGB LED Matrix datasheet.
  • Review Audio MP3 decoder datasheet.
  • Review the extra hardware needed for RGB LED matrix(Power Adapter)
  • Create Gitlab repository
  • Create a shared google drive for the team to share available resources
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
3
  • 11/05/2021
  • 11/09/2021
  • Read and familiarize with Bluetooth module(HC-05)
  • Start driver implementation for RGB LED matrix
  • Test the driver for single row
  • Implement functions for all the rows and columns in RGB LED matrix
  • Decide the graphics and character images for the game
  • Finalize the Wiki Schedule
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
4
  • 11/10/2021
  • 11/15/2021
  • Test the LED driver functioning and should display one of the character from game
  • Review the Audio MP3 functioning
  • Collect audio samples for different scenarios of the game
  • Develop serial MP3 audio encoder driver
  • Interface Serial MP3 encoder with SJ2 Board and check for its functioning
  • Design driver code for Joystick
  • Interface of joystick and SJtwo board and test its functionality
  • Synchronize audio MP3 with the joystick movements
  • Discuss the techniques to handle obstacles
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
5
  • 11/16/2021
  • 11/22/2021
  • Implementation of the game screens on the RGB LED matrix
  • Review game collision detection logic
  • Synchronize the Audio MP3 with the game graphics
  • Start PCB soldering and testing each part after fixing
  • RGB LED matrix should handle graphics for different game levels
  • Finalize sounds for different scenarios in the game
  • Test each module separately and review the code
  • Start designing the PCB circuit using a PCB design software.
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
6
  • 11/23/2021
  • 11/30/2021
  • Interface all the sensors, MP3 audio, Bluetooth module, joystick
  • Test the whole implementation after integrating all the modules
  • Debug and Test all the gaming functionalities for each module
  • Add the developed game logic
  • Test the game after adding the logic
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
7
  • 12/01/2021
  • 12/06/2021
  • Order the final PCB
  • Finalize the video game
  • Test the game logic
  • Check for the bug fixes
  • Start working on Project report
  • Completed
  • Completed
  • Completed
  • Completed
  • Completed
8
  • 12/07/2021
  • 12/13/2021
  • Update Wiki page
  • Work on project report
  • Completed
  • Completed
9
  • 12/14/2021
  • 12/16/2021
  • Individual Assessment
  • Final demo
  • Update git repo with final code
  • Update the Wiki page with game demo link
  • Completed
  • Completed
  • Completed
  • Completed


Parts List & Cost

Item# Part Desciption Vendor Qty Cost
1 SJTwo Boards From Amazon 2 $100.00
2 64x64 RGB LED Matrix Adafruit 1 $92.00
3 Wiring Components and Cable Amazon 1 $20
4 Digi Xbee module From Preet 2 $0
5 HiLetGo Analog 2-axis thumb Joystick Amazon 1 $9
6 MP3 music player (YX5300) Amazon 1 $8
7 5V,4A Power Adapter Amazon 1 $20

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.

Pin Configuration

  • Pin# SJ2 Main Board - LED Matrix Pin Configuration SJ-2 PIN
    R1 PIN for Red terminal of RGB LED for the upper half of LED Matrix P0_0
    G1 PIN for Green terminal of RGB LED for the upper half of LED Matrix P0_1
    B1 PIN for Blue terminal of RGB LED for the upper half of LED Matrix P2_2
    R2 PIN for Red terminal of RGB LED for the lower half of LED Matrix P2_4
    G2 PIN for Green terminal of RGB LED for the lower half of LED Matrix P2_5
    B2 PIN for Blue terminal of RGB LED for the lower half of LED Matrix P2_6
    A Mux pin for row selection P2_7
    B Mux pin for row selection P2_8
    C Mux pin for row selection P2_9
    D Mux pin for row selection P0_16
    E Mux pin for row selection P0_15
    OE Output Enable P1_28
    LATCH Data Latch P1_29
    CLK Clock Signal P0_17
    MP3 Decoder
    RX UART Receive From MP3 Decoder P2_1
    TX UART Send Command from SJ-2 Main Board P2_0
    XBEE Module Receiver
    RX UART Receive From Game Controller P0_11
    VCC VCC Supply VCC 3.3
  • Pin# Controller Board Pin Configuration uC PIN
    XBEE Module Transmitter
    TX UART Transmit to Main Board P0_10
    VCC VCC Supply VCC 3.3
    Joystick
    VCC VCC 3.3V
    GND GND GND
    Vx X-axis ADC Reading for character movement P0_25
    Push Button
    I/0 Pin Arrow Shooting P1_29

Collision detection:

There are two collision detection functions:

  • Check Collision : This function detects the following collisions
    • Bullet to Enemy Collision : The movement of bullet and enemy spaceship is stopped and both are cleared from the screen. Kill count is incremented for level up and respective flags are set. Burst animation is played at the collision spot.
    • Spaceship to Enemy Collision : The movement of enemy spaceship is stopped and it is cleared from the screen. Respective flags are set and burst animation is played at the collision spot.
  • Villian Collision : This function detects the following collisions
    • Bullet to bullet collision : The movement of both the bullets are stopped and both are cleared from the screen.
    • Spaceship to villain bullet collision : The movement of bullet is stopped and it is cleared from the screen. Health of the user spaceship is decremented.

Hardware Design

Printed Circuit Board

Layout & Design

MP3 Serial Player:

MP3 Serial Player module is a simple MP3 player device which is based on a high quality MP3 audio chip. It can support 8kHz - 48kHz sampling frequency MP3 and WAV file formats. Also, this board has a TF card socket so that a SD card can be inserted that stores audio files. SJTwo board can control this module via UART port, such as switch songs, change the volume and play mode, and so on.

The SD card should be formatted as FAT16 or FAT32 and should have some audio files with .mp3 or .wav formats. If user wants to create separate folders then those should be created as “01”, “02” and the songs should be with the names 001xxx.mp3/ 002xxx.mp3/ 003xxx.mp3 in those created folders.

Hardware Interface

Universal Asynchronous Receiver Transmitter (UART) is used as an interface to connect SJTwo board and MP3 Serial Player. UART_3 is configured for YX5300 MP3 player. Below is the pinout connections between UART and MP3 Serial Player:



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

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.

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

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?

Project Video

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

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.