电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

基于51单片机心形流水灯C语言源程序

基于51单片机心形流水灯C语言源程序_第1页
1/15
基于51单片机心形流水灯C语言源程序_第2页
2/15
基于51单片机心形流水灯C语言源程序_第3页
3/15
#i nclu d e<re g 51、h> uns i gned int x,y; void d ela y ms(un s ign ed i nt z) //延时{ﻩunsi g ned i n t i,j; ﻩfor(i=z;i>0;i--) ﻩﻩf or(j=150;j>0;j--); } v o id O n_all() //开启所有灯{ ﻩP0=0 x00; P1=0 x 00; P2=0x0 0; P 3=0 x00; } void Off_all()//关闭所有灯{ ﻩﻩP0=0 xff; P 1=0x f f; P 2=0xff; P3=0x f f; }v oi d ls()//正向流水灯{ P0=0 x 00; d e laym s(400);ﻩP2=0x0 0; del a ym s(400);P3=0x0 0; de la y ms(4 00);ﻩP 1=0x00; delaym s(40 0); ﻩP 0=0 x 01; d el ay ms(50); ﻩP0=0 x 02; d e l ay m s(5 0); P0=0x 04; de la yms(50); P 0=0x08; delayms(50); P0=0x1 0; d e la y ms(5 0); ﻩP0=0x2 0; delayms(50); ﻩP 0=0x 4 0; d e l a yms(5 0); P0=0x80; d e la y ms(5 0); P 0=0 x0 0; ﻩP2=0 x 0 1; del a yms(5 0); P2=0 x 02; delayms(5 0); P2=0x0 4; de l a ym s(50); P 2=0x08; del a ym s(5 0); P2=0x1 0; d e la y m s(50); P2=0x20; dela y ms(5 0); ﻩP2=0 x4 0; del a yms(50); ﻩP2=0x80; d e la ym s(50); ﻩP 2=0 x 00; ﻩP 3=0x 80; del a ym s(50); ﻩP3=0 x40; d ela y ms(5 0); P 3=0 x2 0; de la yms(50); ﻩP 3=0 x10; de l ayms(50); ﻩP 3=0 x0 8; d ela y ms(50); ﻩP3=0x0 4; delay ms(50); P3=0 x02; delay m s(50); ﻩP3=0x 01; d e la yms(50); ﻩP3=0x 00; ﻩP1=0 x 80; delaym s(5 0); ﻩP1=0x40; d e lay m s(50); P1=0 x20; d elayms(5 0); P1=0x10; de l ay m s(5 0); P 1=0x08; delayms(50); P1=0 x0 4; de layms(50); ﻩP1=0 x02; delay m s(5 0); P1=0x01; delay ms(50); ﻩP1=0x00;ﻩOf f_a l l();ﻩP0=0xfe; d e lay m s(50);P0=0xfd; d elaym s(50);ﻩP0=0xf b; d e ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

基于51单片机心形流水灯C语言源程序

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部