基于某51单片机心形流水灯C语言源程序文档格式.docx

上传人:b****6 文档编号:18536293 上传时间:2022-12-19 格式:DOCX 页数:11 大小:15.18KB
下载 相关 举报
基于某51单片机心形流水灯C语言源程序文档格式.docx_第1页
第1页 / 共11页
基于某51单片机心形流水灯C语言源程序文档格式.docx_第2页
第2页 / 共11页
基于某51单片机心形流水灯C语言源程序文档格式.docx_第3页
第3页 / 共11页
基于某51单片机心形流水灯C语言源程序文档格式.docx_第4页
第4页 / 共11页
基于某51单片机心形流水灯C语言源程序文档格式.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

基于某51单片机心形流水灯C语言源程序文档格式.docx

《基于某51单片机心形流水灯C语言源程序文档格式.docx》由会员分享,可在线阅读,更多相关《基于某51单片机心形流水灯C语言源程序文档格式.docx(11页珍藏版)》请在冰豆网上搜索。

基于某51单片机心形流水灯C语言源程序文档格式.docx

{

P0=0x00;

P1=0x00;

P2=0x00;

P3=0x00;

voidOff_all()//关闭所有灯

P0=0xff;

P1=0xff;

P2=0xff;

P3=0xff;

}

voidls()//正向流水灯

P0=0x00;

delayms(400);

P0=0x01;

delayms(50);

P0=0x02;

P0=0x04;

P0=0x08;

P0=0x10;

P0=0x20;

P0=0x40;

P0=0x80;

P2=0x01;

P2=0x02;

P2=0x04;

P2=0x08;

P2=0x10;

P2=0x20;

P2=0x40;

P2=0x80;

P3=0x80;

P3=0x40;

P3=0x20;

P3=0x10;

P3=0x08;

P3=0x04;

P3=0x02;

P3=0x01;

P1=0x80;

P1=0x40;

P1=0x20;

P1=0x10;

P1=0x08;

P1=0x04;

P1=0x02;

P1=0x01;

Off_all();

P0=0xfe;

P0=0xfd;

P0=0xfb;

P0=0xf7;

P0=0xef;

P0=0xdf;

P0=0xbf;

P0=0x7f;

P0=0xff;

P2=0xfe;

P2=0xfd;

P2=0xfb;

P2=0xf7;

P2=0xef;

P2=0xdf;

P2=0xbf;

P2=0x7f;

P3=0x7f;

P3=0xbf;

P3=0xdf;

P3=0xef;

P3=0xf7;

P3=0xfb;

P3=0xfd;

P3=0xfe;

P1=0x7f;

P1=0xbf;

P1=0xdf;

P1=0xef;

P1=0xf7;

P1=0xfb;

P1=0xfd;

P1=0xfe;

P0=0xfc;

P0=0xf8;

P0=0xf0;

P0=0xe0;

P0=0xc0;

P2=0xfc;

P2=0xf8;

P2=0xf0;

P2=0xe0;

P2=0xc0;

P3=0x3f;

P3=0x1f;

P3=0x0f;

P3=0x07;

P3=0x03;

P1=0x3f;

P1=0x1f;

P1=0x0f;

P1=0x07;

P1=0x03;

voidfan_ls()//反向流水灯

{

delayms(300);

On_all();

delayms(400);

delayms(50);

P1=0x04;

P1=0x20;

P1=0x80;

P1=0x00;

P3=0x01;

P3=0x10;

P2=0x80;

P1=0xfc;

P1=0xf8;

P1=0xf0;

P1=0xe0;

P1=0xc0;

P3=0xfc;

P3=0xf8;

P3=0xf0;

P3=0xe0;

P3=0xc0;

P2=0x3f;

P2=0x1f;

P2=0x0f;

P2=0x07;

P2=0x03;

P0=0x3f;

P0=0x1f;

P0=0x0f;

P0=0x07;

P0=0x03;

voidban_shan()//半边交替闪

P3=0x00;

P0=0xff;

P2=0xff;

P3=0xff;

P0=0x00;

P2=0x00;

voidshangxia_shan()//上下交替闪

P1=0x00;

P1=0xff;

voidhuayang_shan()//花样闪烁

delayms(200);

voidmain()

ls();

//正向流水

fan_ls();

//反向流水

ban_shan();

//半边交替闪

shangxia_shan();

//上下交替闪烁

huayang_shan();

//花样闪烁

 

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1