Difference between revisions of "S18: Traffic Menace Video Game"

From Embedded Systems Learning Academy
Jump to: navigation, search
(RGB LED Matrix)
(RGB LED Matrix)
Line 174: Line 174:
 
A 64x64 RGB LED Matrix Panel is used as a display. It has 4096 full-color RGB LEDs. Each LED can be independently addressed and controlled. It requires at 13 digital GPIOs to control the LED matrix. The led matrix has 2 IDC connectors DATA_IN and DATA_OUT on the back, you can cascade multiple panels and make a huge screen together.
 
A 64x64 RGB LED Matrix Panel is used as a display. It has 4096 full-color RGB LEDs. Each LED can be independently addressed and controlled. It requires at 13 digital GPIOs to control the LED matrix. The led matrix has 2 IDC connectors DATA_IN and DATA_OUT on the back, you can cascade multiple panels and make a huge screen together.
  
Pin mapping of RGB LED matrix with SJ One board:
+
RGB LED matrix pins:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-

Revision as of 09:05, 23 May 2018

Traffic Menace

Abstract

The project focuses on developing a game on a 64*64 RGB LED. The game is all about controlling a car on a road having traffic. The LED would be displaying a user-controlled car and road with many different cars on it. The user needs to tilt the LED screen to avoid traffic and safely drive the car. An accelerometer is used to detect the tilt of the LED screen and move the car accordingly. As the level increases, the car speed and frequency of traffic would increase. The user starts the game with 3 lives. Any collision with oncoming traffic results in losing one life, and the game ends after losing all 3 lives. A switch is provided in case the player wants to restart the game anytime. User lives and score are displayed on the LED.

Objectives & Introduction

Our primary goal of this project is to write drivers for the LED and develop a game with FreeRTOS. The position of the car is controlled by the accelerometer. We use the onboard accelerometer in the SJ one board which is connected via I2C. Random traffic is generated at random speed. The speed of the traffic also increases as the level increases. The level can be manually increased by pressing the push button which gives user less time to react. When the game ends after loosing all 3 lives it can restarted by pressing the push button.

The objectives are as follows:

  1. Write drivers to control pixels in LED.
  2. Implement algorithm for controlling car.
  3. Implement algorithms for Traffic and Obstacles.
  4. Continuously update the position of car and traffic.
  5. Continuously update scores.

Team Members & Responsibilities

Schedule

Week# Start Date End Date Task Status Completion Date
1 4/1/18 4/8/18
  • Finalize materials and order parts
Completed 4/07/18
2 4/8/18 4/15/18
  • Set up GitLab
  • Detect board orientation for left and right turn
Completed 4/22/18
3 4/15/18 4/24/18
  • Get the LED Driver work for drawing a line
  • Get the line moving according to board orientation
Completed 4/24/18
4 4/24/18 5/1/18
  • Finalize the PCB Design
  • Collision Detection
  • Implement algorithm for increasing the levels
Completed 4/29/18
5 5/8/18 5/15/18
  • Generate Random Traffic
  • UI for Road and Cars
  • Implement other game features like varying speed, lives and scoreboard
Completed 5/12/18
6 5/15/18 5/22/18
  • Add extra functionalities and extra features for the project
  • Test the entire project with PCB
  • Finalize Wiki Report
Completed 5/20/18

Parts List & Cost

S.No Part Name Cost in $ Qty Comments
1 SJone Board 80 1 LED controller
2 64 x 64 LED Display 81 1 LED Display from Adafruit
3 PCB 30 1 Interfacing Display to SJ One and Power Circuitry
4 Li-po Battery 72 1 Power supply
5 Multimeter 10 1
6 Jumper Wires 5 20 Connections

Design & Implementation

Hardware Design

The system block diagram shows the design of our project with the interface for the sensors

Accelerometer sensor

Accelerometer on board

An accelerometer is an electromechanical device used to measure acceleration forces. Forces may be static, like the continuous force of gravity. Accelerometers are used to detect the orientation of the phone. The gyroscope adds an additional dimension to the information supplied by the accelerometer by tracking rotation or twist. SJOne board has an on-board accelerometer which is interfaced on the I2C2 bus. Based on these values we can control the steering of the car.

Push Button

Push Button are interfaced with the SJOne board via GPIO pins which are interrupt capable. Two push button's are used for restarting and for boost. Once the player looses all 3 lives the player can restart the game with push button. The player can use the other push button for using boost.

RGB LED Matrix

A 64x64 RGB LED Matrix Panel is used as a display. It has 4096 full-color RGB LEDs. Each LED can be independently addressed and controlled. It requires at 13 digital GPIOs to control the LED matrix. The led matrix has 2 IDC connectors DATA_IN and DATA_OUT on the back, you can cascade multiple panels and make a huge screen together.

RGB LED matrix pins:

S.NO RGB LED pins 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 Row select A
8 B Row select B
9 C Row select C
10 D Row select D
11 CLK Clock signal.
12 OE Output enables to cascade LED panel.
13 LAT Latch denotes the end of data.
Features:
  • Operating voltage: DC 5V
  • Average power consumption: <500W/㎡
  • Maxim Power Consumption: <1000w/㎡
  • Pixel: 64x64=4096
  • Level of viewing Angle: ≧160°
  • Control mode: Synchronous control
  • Drive mode: 1/16 scan rate
  • Repetition frequency: ≧60Hz
  • White Balance Brightness: ≧1200cd/㎡
  • Refresh frequency : ≧300Hz
  • MTTF: ≧5000 hours
  • Service Life: 75000~100000 hours
  • Pixel pitch: 3mm
  • Dimension: 190 * 190 * 14.5 mm / 7.48 * 7.48 * 0.57 inches
  • Thickness: 11mm

Printed Circuit Board

EAGLE Schematic

EAGLE Connector List

Hardware Interface Diagram

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.

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.