微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 32LED单片机心形花样流水灯

32LED单片机心形花样流水灯

时间:11-29 来源:互联网 点击:
#include
#include #define uint unsigned int#define uchar unsigned charuchar code zou[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};//单个从0到7uchar code you[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//单个从7到0uchar code liang0_7[]={0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff}; // 逐个点亮0~7uchar code liang7_0[]={0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff}; // 逐个点亮7~0uchar code mie0_7[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00}; // 逐个灭0~7uchar code mie7_0[]={0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00}; // 逐个灭7~0/***********************************************************/void delay(uint t); //延时void zg(uint t,uchar a);//两边逐个亮void qs(uint t,uchar a);//全部闪烁void zgxh(uint t,uchar a);  // 逆时针逐个点亮//void zgxh1(uint t,uchar a);  // 顺时针逐个点亮void djs(uint t,uchar a);  //对角闪void lbzgm(uint t,uchar a);//两边逐个灭//void sszgm(uint t,uchar a); // 顺时针逐个灭void nszgm(uint t,uchar a); // 逆时针逐个灭void sztl(uint t,uchar a);//顺时逐个同步亮void nztl(uint t,uchar a);//逆时逐个同步亮void sztm(uint t,uchar a);//顺时逐个同步灭void nztm(uint t,uchar a);//逆时逐个同步灭void hwzjl(uint t,uchar a); //横往中间亮void hwzjm(uint t,uchar a); //横往中间灭//void swzjl(uint t,uchar a); //竖往中间亮//void swzjm(uint t,uchar a); //竖往中间灭void nzdl(uint t,uchar a); //逆时逐段亮void nzdgl(uint t,uchar a);   //逆时逐段一个点亮void jgs(uint t,uchar a);   //间隔闪/**********************************************************/void zg(uint t,uchar a)//两边逐个亮{uchar i,j;for(j=0;j0;y--);}}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top