登录
首页 » C# » 430单片机贪吃蛇

430单片机贪吃蛇

于 2023-07-30 发布 文件大小:39.78 kB
0 57
下载积分: 2 下载次数: 2

代码说明:

采用msp430f169单片机驱动LCD12864完成的贪吃蛇游戏,共有四个独立按键,分别控制四个不同的方向。应经调试成功。单片机型号为美国TI公司的MSP430f169型。程序各部分均有头文件形式构成,对于初学者便于理解。#include "msp430x16x.h" #include //包含随机数 //液晶引脚定义 #define E_1 P5OUT|=BIT7 #define E_0 P5OUT&=~BIT7 #define RW_1 P5OUT|=BIT6 #define RW_0 P5OUT&=~BIT6 #define RS_1 P5OUT|=BIT5 #define RS_0 P5OUT&=~BIT5 #define PSB_CLR P5OUT &= ~BIT0 //PSB置低,串口方式 #define PSB_SET P5OUT |= BIT0 //PSB置高,并口方式 #define RST_CLR P5OUT &= ~BIT1 //RST置低 #define RST_SET P5OUT |= BIT1 //RST置高 #define uchar unsigned char #define uint unsigned int //按键引脚定义 #define key_state_0 0 #define key_state_1 1 #define key_state_2 2 unsigned char key_state[4]={0,0}; uchar zi[]={0xd3,0xce,0xcf,0xb7,0xbd,0xe1,0xca,0xf8};//游戏结束 uchar fen[]={0xb5,0xc3,0xb7,0xd6};//得分

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 高质量C++/C编程指南
    说明:  软件质量是被大多数程序员挂在嘴上而不是放在心上的东西! 除了完全外行和真正的编程高手外,初读本书,你最先的感受将是惊慌:“哇!我以前捏造的C++/C程序怎么会有那么多的毛病?” 别难过,作者只不过比你早几年、多几次惊慌而已。 请花一两个小时认真阅读这本百页经书,你将会获益匪浅,这是前面N-1个读者的建议。(Software quality is the majority of programmers have paid lip service rather than the heart! In addition to being a complete layman and a real master of programming, your first reading of the book will be a panic: "Wow! How can I have so many problems with the C++/C program I've made up before?" Don't be sad, the author is only a few years and a few times earlier than you panic. Please spend one or two hours reading this 100 pages of Scripture carefully, and you will benefit a lot from it. This is a suggestion from the previous N-1 readers.)
    2017-06-13 15:49:09下载
    积分:1
  • 用C#开发PDA里怎样播放WAV声音,其中要调用CoreDll.dll档的共公类部分...
    用C#开发PDA里怎样播放WAV声音,其中要调用CoreDll.dll档的共公类部分-C# development PDA how to play WAV sound, which must be called CoreDll.dll stalls were part of the public category
    2023-08-07 12:10:03下载
    积分:1
  • DMS
    wpf 使用visual studio 2012 ado.net连接sqlserver 宿舍管理系统(wpf using visual studio 2012 ado.net connection sqlserver hostel management system)
    2014-12-26 16:30:55下载
    积分:1
  • seismic_processing_programme
    地震数字处理的基本程序,其中包括滤波褶积,fft,dft,自相关互相关,以及偏移等,对地质学人员比较有用(Digital processing seismic basic procedures, including convolution filter, fft, dft, autocorrelation cross correlation, and offset, etc., more useful for people geology)
    2013-12-25 15:08:07下载
    积分:1
  • BCEncode
    128条码打印DLL,通用平台都可以调用(128 bar code printing DLL)
    2019-04-21 19:54:54下载
    积分:1
  • shuanglushuzihecheng
    摘要 电能表作为用电量的测量工具广泛的应用于各种场合。在电能表校表系统中,需要的最基本的输入信号源是高精度双路正弦信号源,并要求可对其频率、相位、幅值进行调节,来对电能表进行校准。 基于单片机的程控信号源设计,运用数字调相、数字调幅和数字调频等技术,要求实现相位、幅度、频率的高精度程控调节。本文设计了一种利用锁相环频率合成技术和数字波形合成技术组成的程控低频正弦波信号发生器,并给出了调幅、调频、调相的实用电路,频率调节通过改变8253计数器的分频系数来实现;相位调节由51单片机预置计数器的计数初值来完成,幅度的调整通过改变DAC1210II的参考电压来实现,使频率分辨率达0.01Hz,相位调节精度达0.1°,并介绍电路中的主要芯的功能及使用。输出正弦波频率和幅值的精度高,稳定性好,失真度低,电路简单、可靠、便于程控。 关键词:数字合成信号源;程控;调幅;调频;移相; (Abstract Meter consumption as the size of the measurement tool is widely used in various occasions. In single-phase power meter verify system, the most basic needs of the input signal is the source of two-way high-precision sine signal source, and may request its frequency, phase, amplitude in a certain step to adjust to the imitate of the actual electricity load with a right meter calibration. Design of the programmable signal supply controlled source,which based on the MCU,including digital phase adjustment,distal amplitude adjustment,digital frequency adjustment etc.The system should achieve high quality digital adjustment of phase, amplitude and frequency. This paper describes the use of a PLL frequency synthesizer technology, and digital wave form synthesis technology consisting of program-controlled low-frequency sine wave signal issued devices, and applies the amplitude, frequency, phase of practical circuit. Frequency can be adjusted through a change in the 8253 counter-frequ)
    2021-04-08 20:19:00下载
    积分:1
  • MFC多个树控件的应用
    MFC对话框中多个树控件的应用,希望对大家有帮助。总共有三级树控件,上层树控制下层树。
    2022-11-01 23:05:09下载
    积分:1
  • Onboard-SDK-3.1 (1)
    大疆SDK,完美移植到STM32F1的平台(Dji SDK, perfect transfer to STM32F1 platform)
    2020-06-29 04:40:02下载
    积分:1
  • Upload-AND-Download-File
    使用FileReference+HttpHandler 实现文件上传/下载( use FileReference and HttpHandler upload and download)
    2013-09-23 15:38:37下载
    积分:1
  • cross-correlation-operation
    通过此函数能实现两个序列的互相关运算,应用比较广泛(Used widely by the cross-correlation operation of this function to achieve the two sequences)
    2012-05-30 22:41:05下载
    积分:1
  • 696518资源总数
  • 105714会员总数
  • 27今日下载