- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
基于51单片机的流水灯程序(已通过)(Based on 51 singlechip water lamp program (has been adopted))
基于51单片机的流水灯程序(已通过)(Based on 51 singlechip water lamp program (has been adopted))
Title: 51 SCM light water C language source program 2008-12-06 08:43:05
**************************************************************
File name: flash_led.c
File Description: water lamp C program
Write the date: October 5, 2006
Program description: MCU using AT89S51, external 12M crystal, P1 port output
*************************************************************/
#include Series MCU //51 definition file
#define uchar unsigned char / / definition unsigned char
#define uint unsigned int / / define unsigned integer
Void delay (uint); / / statement delay function
Void main (void)
{
Uint i;
Uchar temp;
While (1)
{
Temp=0x01;
For (i=0; i8; i++) //8 water lights flashing one by one
{
P1=~temp;
Delay (100); / / call delay
Temp=1;
}
Temp=0x80;
For (i=0; i8; i++) //8 flashing light water reverse one by one
{
P1=~temp;
Delay (100); / / call delay
Temp=1;
}
Temp=0xFE;
For (i=0; i8; i++) //8 water lights are all lit
{
P1=temp;
Delay (100); / / call delay
Temp=1;
}
Temp=0x7F;
For (i=0; i8; i++) //8 water lights are all lit reverse
{
P1=temp;
Delay (100); / / call delay
Temp=1;
}
}
}
Void delay (uint T) / / definition of delay function
{
Register uint bt;
(for; t; t--)
For (bt=0; bt255; bt++);
}
/************************************************************
*89C51, S51 microcontroller 32 IO port lights water testing procedures
*Flash0, 1, 2, 3 respectively, 1 MCU P0, 2, 3 four mouth
The *a program from the corresponding water lights Quanmie to a bright
*b light water program corresponding to a light from a death
*2006-7-26 10:57, OK!
*************************************************************/
#include
#include
#include
#define uchar unsigned char
#define uint unsigned int
#define TimeDelay 60000
Void delay (uint n);
Void Flash0a (void);
Void Flash0b (void);
Void Flash1a (void);
Void Flash1b (void);
Void Flash2a (void);
Void Flash2b (void);
Void Flash3a (void);
Void Flash3b (void);
/**************
您可能关注的文档
- 名解+知识(Famous solution + knowledge).doc
- 名解填空(Cloze).doc
- 名言(合作与竞争)(Famous saying (cooperation and competition)).doc
- 名言佳句(Logion).doc
- 名言名句欣赏全集.doc
- 名言警句——辞典(Dictionary of famous sayings).doc
- 名言警句二(Famous aphorism two).doc
- 名词中医的2(2 of Chinese Medicine).doc
- 名词名句(Noun phrase).doc
- 名词中医的4(4 of Chinese Medicine).doc
- 基于ad 的电容触摸按键电路设计(Design of capacitive touch key circuit based on ad).doc
- 基于fpga流水线分布式算法的fir滤波器的实现 - 世(Implementation of FIR filter based on pipelined distributed algorithm in FPGA).doc
- 基于catalog 的rman 备份与恢复(Backup and recovery of RMAN based on catalog).doc
- 培计划模块三阅读测验答案(Module three read the test answer).doc
- 基于人与组织匹配的高速公路员工职业生涯管理(Career management of Expressway employees based on human and organizational matching).doc
- 基于人机工程学健康座椅设计(Ergonomics based health seat design).doc
- 基于单片机的高精度频率计设计(Design of high precision cymometer based on single chip microcomputer).doc
- 基于msp430f427单片机高精度智能语音数字温度计的设计(Design of high precision intelligent speech digital thermometer based on msp430f427).doc
- 基于msp430的可调电子万年历(无rtc)(Adjustable electronic calendar based on MSP430 (without RTC)).doc
- 基于微机控制的太阳能最大功率跟踪控制及其仿真_小论文(Solar maximum power tracking control of microcomputer control and simulation based on small _).doc
文档评论(0)