已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
键控流水灯 2 #include unsigned int led=0x01,0x02,0x04,0x08; void delay(unsigned int time) unsigned int j; for(;time0;time-) for(j=0;j=0;i-) P2=lesi; delay(200); else P2=0; -串行静态数码显示实验“89c51” 3- #include #include #define uchar unsigned char #define uint unsigned int sbit din=P10; sbit clk=P11; unsigned char table = 0x7F,0x6F,0x39,0x6D,0X06; void write(uchar dat) uchar i; for(i=0;i 0 ; i-) for(j = 110 ; j 0 ; j-); void main() while(1) write(table0); write(table1); write(table2); write(table3); write(table4); delay_ms(10); -动态扫描数码显示实验- -”168168”-4- #include unsigned char tab = 0x7F,0x7d,0x06,0x7f,0X7d,0x06; unsigned char led = 0x01,0x02,0x04,0x08,0X10,0x20; void delay(unsigned int time) unsigned int j=0; for(;time0;time-) for(j=0;j unsigned char t; sbit control=P10; void delay(unsigned int time) unsigned int j=0; for(;time0;time-) for(j=0;j unsigned int i; sbit control = P10; timer1 () interrupt 1 i+; if(1000 = i) / i=100 时,为 1 秒。IO 口反 转,继电器断开 i=0; control = control; TH0 = 0xFC; /灯亮 1 秒 TL0 = 0x18; main() control = 1; / 三极管(PNP )导通, 继电器闭合。 (用 NPN,则 MOTOR = 1) TMOD = 0x01; TH0 = 0xFC; TL0 = 0x18; EA=1; ET0=1; TR0 = 1; while(1); -74ls164 串转并实验 7- 预期实验现象:发光二极管先右移动两次,再左移动两次,然后闪烁两次。 #include unsigned char table= 0x01,0x02,0x04,0x08, 0x10,0x20,0x40,0x80; void delay_ms(unsigned int xms) unsigned int j=0; for(;xms0;xms-) for(j=0;j unsigned char code dispcode=0x3f,0x06,0x5b,0x4f,0x66,0x6d,0 x7d,0x07,0x7f,0x6f; unsigned char second; unsigned char keycnt; unsigned int tcnt; void main(void) unsigned char i,j; TMOD=0x02; ET0=1 ; EA=1; second=0; P0=dispcodesecond /10; P2=dispcodesecond%10; while(1) if(P3_5=0)消抖程序 for(i=20;i0;i-) for(j=248;j0;j-); if(P3_5=0) keycnt+; switch(keycnt) case 1: TH0=0x06; TL0=0x06; TR0=1; break; case 2: TR0=0; break; case 3: keycnt=0; second=0; P0=dispcodesecond/10; P2=dispcodesecond%10; break; while(P3_5=0); void t0(void) interrupt 1 using 0 tcnt+; if(tcnt=400) tcnt=0; second+; if(second=100) second=0; P0=dispcodesecond/10; P2=dispcodesecond%10; -8*8led 点阵显示 10- #include /unsigned char tab=0xff,0xff,0x06,0xd6,0xd0,0xd6,0xd6,0xf f; /显示 th /unsigned char lin=0x01,0x02,0x04,0x08,0x10,0x20,0x40,0 x80; /显示 th unsigned char tab=0xff,0xd7,0x81,0x77,0xc1,0xf7,0x80,0xf f; /显示 生 unsigned char lin=0x01,0x02,0x04,0x08,0x10,0x20,0x40,0 x80; /显示 生 /unsigned char tab=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f; /单列左移 /unsigned char lin=0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff; / 单列左移 void delay(int x) int i,j; for(i=0;i char led1 = 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 ; char led2 = 0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xff, 0x44,0x54,0x54,0x7f,0x54,0x56,0x44,0x480xff, 0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xff, 0xfb,0x80,0xbb,0xa1,0xab,0xa1,0xbb,0xbb; void delay(unsigned int z) unsigned int j; for(;z0;z-) for(j=0;j sbit P1_0=P10; void delay (unsigned int time) int j; for(;time0;time-) for(j=0;j #define uchar unsigned char void delay(unsigned int time) unsigned int j=0; for(;time0;time-) for(j=0;j15) counter=0; delay(5000); 发送程序 #include #define uchar unsigned char void main(void) uchar receiv
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 学前聋儿融合教育
- 2025年65普法知识竞赛试题库及答案
- 重阳节的介绍
- 文创设计课程汇报
- 2025版急性肾炎常见症状及护理注意事项
- 2025版甲亢的症状及中医调理护理方案
- 远离暴力影响增强自我防范
- 2025版痛经常见症状及护理方法培训
- 高处作业安全培训初培理论试题及答案D
- 呼吸与危重症医学科规培护士法律法规考试题与答案
- 2025年肿瘤内科正高试题及答案
- 水务大数据分析与应用-洞察及研究
- 十八项电网重大反事故措施第一课培训课件
- 计生科应急预案(3篇)
- 修理扫帚课件
- 治边稳藏课件
- -T-CAPA-11-2024《女性阴道松弛症诊断与治疗规范》
- 医院消防安全管理架构及人员职责
- 小小园艺师教学课件
- 2025辽宁出版集团选聘18人笔试题库及答案详解
- 中国科学院杭州医学研究所招聘人员笔试高频难、易错点备考题库及参考答案详解
评论
0/150
提交评论