F19: Alien Wars

From Embedded Systems Learning Academy
Revision as of 06:34, 18 December 2019 by Proj user9 (talk | contribs) (Thumb Joystick - SJTwo Board interface)

Jump to: navigation, search

Alien Wars

Abstract

Alien wars is a single player combat game, with increasing levels of difficulty. Each level has a has target number of enemy spaceships to be destroyed, before the ultimate villain ‘the alien king’ appears. Once the ultimate villain is killed the player proceeds to next level. The speed of the enemy spaceships approaching the player will increase with the increasing levels. The player can choose to either shoot the enemy spaceship using missiles or dodge it. The game ends when the player crashes with enemy spaceship.

Objectives & Introduction

This section includes the high level details of our project.

Team Members & Responsibilities

  • Abhinandan Burli
    • Developing enemy game algorithm
    • Developing game characters on LED matrix display
    • GPIO driver for LED matrix display
  • Joel Samson
    • Joystick interfacing - ADC driver
    • Bluetooth Interfacing and developing UART driver for transmitter & receiver
    • GPIO driver for LED matrix display
  • Basangouda Patil
    • Speaker and MP3 encoder interfacing - UART driver
    • Developing game sounds
    • GPIO driver for LED matrix display

Schedule

Week# Date Task Status Actual Completion Date
1 10/1/2019
  • Submission of Project Proposal
  • Complete
  • 10/7/2019
2 10/8/2019
  • Alien Wars Project Approved
  • Complete
  • 10/14/2019
3 10/15/2019
  • Create Wiki page for our project
  • Submit project plan for upcoming weeks
  • Complete
  • Complete
  • 10/21/2019
4 10/22/2019
  • Research Required Components - LED matrix display, Joystick, Bluetooth module, MP3 encoder
  • Order Parts and Identify Roles
  • Complete
  • Complete
  • 10/28/2019
5 10/29/2019
  • Analyze the hardware components - Bluetooth, LED Matrix display, MP3 encoder, joystick module.
  • Read datasheets of all the components
  • Complete
  • Complete
  • 11/4/2019
6 11/5/2019
  • Develop basic game design, wiring and GPIO driver for LED matrix display.
  • Test LED matrix display
  • Print characters for start screen
  • Complete
  • Complete
  • Complete
  • 11/11/2019
7 11/12/2019
  • Display objects on screen, control dynamic movement of player spaceship.
  • Develop UART driver for wireless joystick communication (Bluetooth HC05 module)
  • Complete
  • Complete
  • 11/17/2019
8 11/19/2019
  • LED matrix integration with game.
  • Develop enemy spaceships game algorithm
  • Develop ADC driver for joystick interfacing
  • Develop UART driver for MP3 encoder to play game sounds
  • TODO
  • TODO
  • TODO
  • Complete
  • 11/26/2019
9 11/26/2019
  • Joystick Integration with LED matrix display
  • Develop missile collision and player life algorithm
  • TODO
  • -/-/2019
10 12/3/2019
  • Initial game Testing
  • Source code optimization
  • TODO
  • -/-/2019
11 12/10/2019
  • Integration Testing
  • Bug Fixes
  • TODO
  • -/-/2019
12 12/17/2019
  • Final bug fixes and troubleshooting.
  • Complete wiki report and final demo.
  • TODO
  • -/-/2019

Parts List & Cost

Item# Part Desciption Vendor Qty Cost
1 SJTwo Boards From Preet 3 $150.00
2 32x64 RGB LED Matrix Adafruit 1 $92.00
3 Wiring Components and Cable Amazon 1 $20
4 HC05 Bluetooth module Amazon 2 $35
5 Adafruit Analog 2-axis thumb Joystick Adafruit 1 $9
6 MP3 music player (YX5300) Amazon 1 $8

Design & Implementation

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

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.

Thumb Joystick - SJTwo Board interface

The thumb joystick communicates with LPC408x controller via two ADC pins. The joystick provides two outputs: X-axis and Y-axis. The X-axis output (joystick) was connected to pin P0.25 (ADC2) and Y-axis output (joystick) to pin P0.26 (ADC3) of the micro controller. Based on the input readings a threshold level was defined. The corresponding enum was sent via Bluetooth to the receiver controller.

ADC initializing steps -

 
void adc__initialize_alien(void)
{

   Turn ON ADC peripheral;
   make ADC operational;
   set ADC clock;
   Set Pin functions;
   select ADC channels;
   start burst mode;

} 

Threshold range for different joystick movements -

void set_joystick_control_signal(void) {

  if (received_data == 1)
    joystick_control_signal = down;
  else if (received_data == 2)
    joystick_control_signal = up;
  else if (received_data == 3)
    joystick_control_signal = left;
  else if (received_data == 4)
    joystick_control_signal = right;
  else if (received_data == 5)
    joystick_control_signal = right_up_diagonal;
  else if (received_data == 6)
    joystick_control_signal = right_down_diagonal;
  else if (received_data == 7)
    joystick_control_signal = left_up_diagonal;
  else if (received_data == 8)
    joystick_control_signal = left_down_diagonal;
  else if (received_data == 9)
    joystick_control_signal = bullet;
  else
    joystick_control_signal = center;
}

Testing & Technical Challenges

This section includes information about testing and the technical challenges we faced while developing this project

  • Technical Challenges
    • Flickering of data
    • Bluetooth master - slave configuration

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.