单片机心形灯程序

上传人:飞*** 文档编号:32421429 上传时间:2018-02-11 格式:DOC 页数:14 大小:12.56KB
返回 下载 相关 举报
单片机心形灯程序_第1页
第1页 / 共14页
单片机心形灯程序_第2页
第2页 / 共14页
单片机心形灯程序_第3页
第3页 / 共14页
单片机心形灯程序_第4页
第4页 / 共14页
单片机心形灯程序_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《单片机心形灯程序》由会员分享,可在线阅读,更多相关《单片机心形灯程序(14页珍藏版)》请在金锄头文库上搜索。

1、#include#define uchar unsigned charuchar flag=200;/uchar code Tab1=0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F,0xFF;/ uchar code Tab2=0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0xFE,0xFF;/ uchar code Tab3=0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00;/ uchar code Tab4=0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x00

2、;/ uchar code Tab5=0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0xff;uchar code Tab6=0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xff;uchar code Tab7=0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe;uchar code Tab8=0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f;uchar code Tab11=0xFE,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0xff;/

3、 uchar code Tab22=0x7F,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0xff;uchar code Tab33=0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0xFF;uchar code Tab44=0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF;uchar code Tab55=0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff,0xff;/P1/uchar code TabP1=0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0xFE,

4、0xFF;/ uchar code TabP2=0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F,0xFF;/ uchar code TabP3=0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x00;/ uchar code TabP4=0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x00;/ uchar code TabP5=0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xff;/ uchar code TabP6=0x00,0x80,0xC0,0xE0,

5、0xF0,0xF8,0xFC,0xFE,0xff;uchar code TabP7=0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F;uchar code TabP8=0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0xFE;uchar code TabP11=0x7F,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0xff;uchar code TabP22=0xFE,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0xff;uchar code TabP33=0x01,0x03,0x07,0x

6、0F,0x1F,0x3F,0x7F,0xFF;uchar code TabP44=0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0xFF;uchar code TabP55=0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF;/void shansuo();void xl();/void delay(void)unsigned char m,n;for(m=0;m0;flag=flag-50)P0=0xff;P1=0xff;P2=0xff;P3=0xff;for(i=0;i0;flag=flag-10)for(i=0;i8;i+)P

7、2=0xff;P3=0xff;P1=TabP1i;P0=Tab1i;delay();for(i=0;i9;i+)P1=0xff;P0=0xff;P2=Tab1i;P3=Tab1i;delay();flag=10;for(i1=0;i130;i1+)for(i=0;i8;i+)P2=0xff;P3=0xff;P1=TabP1i;P0=Tab1i;delay();for(i=0;i9;i+)P1=0xff;P0=0xff;P2=Tab1i;P3=Tab1i;delay();flag=200;/void js(void)/uchar i;hy2_3();for(i=0;i3;i+)P0=0xff;P

8、2=0xff;delay();delay();P0=0x00;P2=0x00;delay();delay();/for(i=0;i3;i+)P1=0xff;P3=0xff;delay();delay();P1=0x00;P3=0x00;delay();delay();/for(i=0;i3;i+)P1=0x00;P3=0x00;P0=0x00;P2=0x00;delay();delay();P1=0xff;P3=0xff;P0=0xff;P2=0xff;delay();delay();/void main(void)while (1)azzy_1();/hy2(); /360hy3(); /3

9、60hy2_1();/90hy2_2();/180hy2_3();/180hy3();hy2_4();/hy1(); /90jc();/hy1();hy4(); /90?jc();hy4();/hy5();/jr();/azzy();/azyy();/xl(); /shansuo();/()/led_flow1();/lzyy(); /led_flow1();/azyy(); /shansuo();/sxb();/azzy();/lzyy();/azzy();/lzyy();/shansuo();/azyy();/lzyy();/azyy();/lzyy();/shansuo();js();/

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 教育/培训

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号