Lattice Game Design Report

Source: Internet
Author: User

Comba Cup Electronic Design report

title:A problem dot matrix game machine

member list:

the years A Month

Directory

1. design Tasks ... ..... ..... ..... ..... ... .. ........................... 3

1.1 Basic requirements ... ... .... ... ... ... ... ... ... .... ... .... ... .... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ........ 3

1.2 Play part of ... ..... ... 3 ...., ..., ..., ..., ..., ..., and ..., and ...----and ...-------to--...--????????????????!!!!!!!!!!!!!!!!.

1.3 description ...... ..... ..... ... 3. ...-------...----...----------------------------.

2 . Project demonstration and comparison ..... ..... .......-.....???????????????. 3

2.1 Show section .... ..... ..... ... 3. ...., ..., ..., ... and so on.------and ...-------------------..????

2.2 Circuit design ..... ..... .... 3 ... and ..., ....-----------------------------.???????????

2.3 of the current is put in the majority ... ..... ... 4 .....???????????????????????????????????????????????!!!!!!!!!!!!!!.

2.4 Component Selection ..... .... .... 4 .... ...., ..., ..., ..., and so on, ... and so on.----------???????????????????????!!!!!!!!!!!!!!!!

3. Overall programme ..... .... 4 ... .-----------...--------------------.

3.1 How it works ... and ..... ... 4. ... and ..., ..., ..., ..., ..., ..., ...----------the principle of the work of ..., ..., and so on.--------

4 . System hardware Design ..... ..... ..... ... .. ........................ 4

4.1 stc89c58 Single-chip microcomputer minimum system ..... ..... ..... ..... ....................... 4

5 . System Software Design ....... ..... ..... ... .. ..... 5 ....???????????????

5.1 Main program flow ...... ..... .... ... 5 ....????????????????????????????????????????????????!!!!!!!!!!!!!!.

5.2 Flappy Bird Sub-program ...... ..... ..... ..... ..... .... 6 .....??????????????????

5.3 Flight program ..... ..... .... 6 .....?????????????????????????????????????????!!!!!!!!!!!!!!!!!!!!!!!.

6 . Testing and analysis of results ..... ... . ..... ..... ..................... 7

6.1 Basic part of testing and analysis ..... ... 7 .....????????????????????????????????????????????!!!!!!!!!!!!!!!!!!!!.

6.2 Play part of the test and analysis ..... .... 7 .....????????????????????????????????????!!!!!!!!!!!!!!!!!!!!!!!!!!.

7 . Design Summary ..... ..... ..... ... .. 7. ....?????????????????????????

8 . reference materials ... ..... ..... .... ..... ......., ... and ... and ... and ... . ............... 7

Appendix ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ... .. ......... 7

1 Task design

1.1 Basic requirements : design and production of dot-matrix game consoles.

1.1.1 uses 16*16 lattice to achieve the most basic display function, can display the digital 0~9 and all English letters;

1.1.2 can display Chinese characters, and kanji must include the academy and name of the participant.

1.1.3 increases the gravity sensing function, can automatically rotate the screen according to Gravity, display Chinese characters;

1.1.4 all the display programs are rolling display, you can see the scrolling effect;

The 1.1.5 system is battery-powered and works conveniently in hand.

1.2 Play part :

1.2.1 In the basic part of the foundation, design a button-based Flappy Bird game;

The 1.2.2 console is accompanied by music that is powered on.

The 1.2.3 game has the function of displaying score and so on;

The occurrence frequency or the size of the obstacle in the 1.2.4 game machine must have the randomness, otherwise the play part cannot divide;

1.2.5 Play your imagination;

1.3 Description

1.3.1 Gravity sensing available with Mercury switch design

1.3.2 recommended use of 16*16 lattice modules

In the 1.3.3 game, the controlled bird has the gravitational acceleration (non-uniform descent)

2. Program Demonstration

2.1 Show Section :

The Display section is the core part of this design, for 16*16 lattice display has the following two kinds of scenarios:

Scheme one: Adopt four latches, easy to realize the rotation of the screen; disadvantages: difficult wiring, difficult to achieve on a board, the impact of beautiful design.

Scenario Two: The use of decoders, easy wiring, but increased the screen to flip the difficulty, the screen vision of the temporary effect of poor, flashing obvious.

In view of the above reasons, we adopt Programme II

2.2 . Circuit Design

This circuit design is different from the former Science and engineering division of the module task, multi-module set together, wiring difficult, there are the following two kinds of options:

Plan one: Drawing PCB, circuit aesthetics and the connection between components is greatly simplified, because has not tried this kind of board, and time is urgent, so give up

Scenario Two: The use of artificial equivalent, that is, accurate to a point on the hole board, draw an equivalent figure

In view of the above reasons, the adoption of programme II

2.3 The current is put mostly

Because of the circuit design problems, the current is not up to the dot matrix, the digital tube and buzzer work at the same time requirements, it is necessary to amplify the current, there are the following two options:

Scenario One: The use of transistor amplification, transistor in the Assembly of the buzzer circuit, but if the use of lattice must be 32 transistors, greatly aggravating the wiring and welding difficulty, affecting the appearance of the circuit.

Scheme two: using latch to enlarge, greatly simplifies the difficulty of circuit implementation

For these reasons, select Scenario Two.

2.4 Component Selection

Choose 58 Single-chip microcomputer, 74ls154n decoder, 16*16 lattice, digital tube, active buzzer, 12.000 crystal oscillator, led, transistor, exclusion, resistance, capacitance, touch switch, mercury switch and self-locking switch, two 3V coin cell batteries.

3. Overall plan

Working principle :

Using single chip microcomputer STC89C58 as the central control module of this system. 16*16 lattice as the main display module, the single-chip computer to show the data, and can achieve scrolling display. Use the switch to the ground to transmit to the I/O port operation signal. In the display circuit, mainly by the key to achieve a variety of display requirements of the selection and switching.

4. System Hardware Design (unit circuit design and analysis)

4.1 stc89c58 single chip microcomputer minimum system :

The minimum system includes a crystal oscillator circuit and a power supply section. Figure 2 is the smallest system of the STC89C58 microcontroller.

Figure 1 Minimum System circuit diagram

5 , System software design

5.1 Main program 2

5.2 Flappy Bird3

Figure 3 Flappy Bird Flowchart

5.3 Flight Procedure 4

6. Test and analysis of the results

6.1 Basic part testing and analysis

Testing and analysis of the basic Requirements section:

(1) After power on the system, full screen light, no dark spots. The player information is then displayed. Press the yellow key and switch to enter the game.

(2) can be rotated in four directions of the screen.

(3) Can implement text scrolling display

6.2 play a part in testing and analysis:

(1) Play the boot music when the switch is pressed.

(2) Digital tube display score can be achieved

(3) The obstacles appearing in the game are random, and there will be no fixed bug with multiple operation phenomena.

(4) Increased flying game, normal operation

7. Design Summary

Fully prepared for a full one months, from the very beginning of the selection of a question of confidence, to meet setbacks and time conflicts when the confidence wavered, and then the division of labor unreasonable result in the individual burden of overweight. From this game, we harvest is not only a piece of beautifully designed board, also harvested the first lesson in electronic design: Do not abandon, do not give up, there will always be a harvest.

8. References

[1] "51 single-chip microcomputer C language Course" Guo Tianxiang series of electronic Industry Press

[2] Advanced Language Program Design

Appendix:

Game Main Frame Program

#include "head.h"//header files, including bit definitions, definitions of global variables, and function declarations

void Main ()

void music ()//boot

void Int0 () interrupt 1//Music function call with interrupt 0 control beat

void Delay1 (unsigned char m)//Music function call, control frequency delay

void delayms (unsigned char a)//music function call, Hao-second delay subroutine

void Hanzixianshi ()//Kanji display function, show Academy, name before game start

void Flappy ()//flappy Bird Games

void plane ()//aircraft Games

void Bird ()//Bird game call, down

void Die_or_not ()//Bird game Judge bird dead Not dead

void Shang ()//bird game call, fly up

void Kaihuo ()//airplane game call, firing bullets

void Win_or_lose ()//Airplane game call, judging whether it is dead or scored

void Zuohanshu ()//Airplane game call, left shift function

void Youhanshu ()//Airplane game call, right Shift function

void renew_table ()//array update

void Zhuan (Uchar n,uchar K,uchar i0)//flip function, assigning values to the array (size 16) that will be hit on the screen for different N and K

Uchar Diandao (Uchar temp)//due to the difficulty of the board design, the P1 port needs to be upside down

void delay (UINT z)//delay function

void unit ()//Extinguish all lights

void timer () interrupt 3//timer, generating random numbers

void Shumaguan (Uchar k)//Digital tube display

Lattice Game Design Report

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.