更新时间:12-02 上传会员:莉雅
分类:单片机论文 论文字数:7987 需要金币:1000个
摘要:本设计是通过AT89C52单片机来实现俄罗斯方块游戏,使用C语言进行编程,并通过软件来进行仿真。
设计要实现的最今本的功能是:用按键控制图形的转与移动;消除一横行计分;一次消除多行多给分。方块满了游戏结束等。为了解决外部电路图,必须了解所用液晶的显示方法和单片机的外部接口功能,和需要的逻辑关系;并且要了解LCD液晶如何控制的原理;通过端口来实现方块在LCD上的显示。
程序方面要对外部电路了解的前提下完成需要的功能,将要完成的功能用编程语言来实现。之后通过Protues仿真实现用外部按键来控制不一样的图形的方块来玩游戏,还可以实现记录分数和通关数目改变方块下降的速度,分数越多关数越高下降速度越快。最后将程序下载到AT89C52单片机并进行运行,本设计可以实现基本的游戏功能,达到预期的目的。
关键词:C语言;AT89C52;LCD液晶;Proteus仿真
ABSTRACT:This design is achieved through the AT89S52 microcontroller Tetris game design, programming using C language, and carried out by proteus simulation.
The design to achieve the basic functions are: application buttons to control the box, change and movement; eliminate line and scoring; eliminate multi-line incentive points, the game ends when the box filled with basic functions such as Tetris. MCU in the application of handheld entertainment devices have great potential, it can be brought to a new stage. In order to solve the external circuit, we must fully understand the liquid crystal display method and external interface MCU features, and the need to address the logical relationship; also understand that the principle of LCD liquid crystal control to a data port and control port to achieve the above the LCD screen display.
Program requires knowledge of the external circuit where they need to complete the function and the function to be completed in the form of programming language used to achieve. Simulation then protues buttons to control an external box to play a variety of graphical games, and achieve record number of scores and the relationship had to change the speed of the module down. Finally, the program downloaded to AT89S52 MCU and the actual operation, the actual operation indicate that this design can achieve basic game functions, to achieve the desired purpose.
Key Words:C language; AT89S52; LCD liquid cryst ;Proteus simulation