- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
立体led七彩走马灯程序(Stereo LED colorful lantern program)
立体led七彩走马灯程序(Stereo LED colorful lantern program)
/ * * / Producer: Wu Haorong
#includereg52.h
#define uint unsigned int
#define uchar unsigned char
Uint I, B; / / num;
Uchar n=0;
Uchar count;
Sbit key0=P3^2;
Sbit key1=P3^3;
/ / define 9 positive control LED
Sbit l1=P1^7;
Sbit l2=P1^6;
Sbit l3=P1^5;
Sbit l4=P1^4;
Sbit l5=P1^3;
Sbit l6=P1^2;
Sbit l7=P1^1;
Sbit l8=P1^0;
Sbit l9=P3^7;
The definition of the three LED negative control / /
Sbit com3=P3^0;
Sbit com2=P3^1;
Sbit com1=P3^4;
/ / function declaration
Void delay (uint z); / / delay function statement
Void (Ceng); / / bright
Void singal (uint a); / / single light
Void (GRB); / / bright red green blue
Void (Red); / / bright red
Void (GRB2); / / red and green
Void (GRB3); / / on
Void Danheng (uint Num); / / Wang Liang
Void danheng2 (uint num);
Void (Qianjing); / / forward effect
Void (qianjing2); / / second forward effect
Void (main)
{
TMOD=0x01; / / set the timer
TH0= (65536-50000) /256; //10 (MS once the internal oscillator is about 6MHZ)
TL0= (65536-50000)%256;
EA=1; / / total allowable interruption
ET0=1;
TR0=1;
While (1)
{
If (n==1) ({ceng);};
If (n==2) {singal (300);};
If (n==3) ({GRB);};
If (n==4) ({GRB3);};
If (n==5) {danheng (400) danheng2 (400);};
If (n==6) ({qianjing);};
If (n==7) ({qianjing2);};
}
}
Void time0 (interrupt) 1// interrupt 1
{
TH0= (65536-50000) /256;
TL0= (65536-50000)%256;
Count++;
If (count==2)
{
Count=0;
If (key0==0)
{
N++;
If (n==8 {n=1);}
}
}
If (key1==0)
{
While (1)
{
For (i=4; i0; i--)
{
(Ceng);
}
P1=0x00; / / close
L9=0;
For (i=3; i0; / / i--) by light
{
Singal (350);
}
For (i=4; i0; i--)
{
Singal (200);
}
//for (i=4; i0; i--)
//{
/ / singal (180);
//}
(GRB); / / red green blue light
(Red);
(GRB2);
(GRB3);
Danheng (600);
Danheng2 (600);
Danheng (400);
Danheng2 (400);
For (i=11; i0; i--)
{
(Qianjing);
}
For (i=5; i0; i--)
{
(qianjing2);
}
}
}
}
Void delay (uint z)
{
Uint x, y;
For (x=z; x0; x--)
For (y=110; y0; y--);
}
Void (Ceng) / / from top to bottom, then from top to bottom
{
P1
您可能关注的文档
- 物理解题方法(Physics solving method).doc
- 猫哆哩中国糖果业的黑马是如何快速崛起的(Cat Duo, China's candy industry dark horse is how to rise rapidly).doc
- 猪血提取加工制造工艺技术及配方(Technology and formula of pig blood extraction and processing).doc
- 猴子的飞行轨迹与进攻套路.doc
- 玄关的历史文化(The historical culture of vestibule).doc
- 玄关门厅的设计方法(Entrance hall design method).doc
- 玉之鉴赏(Appreciation of jade).doc
- 玉树地震·新闻词汇特辑(Yushu earthquake news edition).doc
- 玉皇玉奏朝科(Jade Emperor Yu served as a branch of the court).doc
- 玉龙雪山(Yulong Snowmountain).doc
- 立体主义服装解析(Fashion analytic cubism).doc
- 移动互联网需要了解的35个企业(Mobile Internet requires understanding of 35 enterprises).doc
- 立体停车场(multistory parking area).doc
- 立体几何初步(举例)(Solid geometry preliminary (example)).doc
- 空调加氟知识大全(Air conditioning fluoride knowledge Daquan).doc
- 立体派对现代派影响(The modernist influence of stereoscopic parties).doc
- 立体推箱子攻略(Three dimensional push box introduction).doc
- 立秋灸关元,立春灸气海——升阳养生灸法(The beginning of autumn, Guanyuan, Qihai, spring sun health moxibustion moxibustion).doc
- 竖向不规则好难调啊~~~(Vertical irregular, difficult to adjust ah ~ ~ ~!).doc
- 立足优势打造陆海空立体交通(Based on the advantages of building land, sea and air three-dimensional transportation).doc
最近下载
- 新版《工会基础知识》试题库集及答案汇总-下(判断、填空、简答题).pdf VIP
- 海拔高度与气压、空气密度、重力加速度对照表.xls VIP
- Unit 5 Languages around the World 第3课时 Discovering useful structures grammar高一英语(人教版2019必修第一册).pptx VIP
- 老年人生理与心理概论知到课后答案智慧树章节测试答案2025年春白城医学高等专科学校.docx VIP
- 风险管理报告医疗器械.docx VIP
- 供应商管理卡.doc VIP
- 大学生职业生涯发展与规划(第二版)PPT完整全套教学课件.pptx VIP
- 基孔肯雅热如何预防培训课件.pptx
- 天然气体积流量计的典型故障问题 流量计解决方案.docx VIP
- 外研版英语八年级下册同步教材课本习题答案.docx VIP
文档评论(0)