32种花样流⽔灯c语⾔程序,32LED单⽚机⼼形花样流⽔灯程序
+视频
include
#include
#define uint unsigned int
#define uchar unsigned char
uchar code zou[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};//单个从0到7
uchar code you[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};//单个从7到0
uchar code liang0_7[]={0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff}; // 逐个点亮0~7
uchar code liang7_0[]={0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff}; // 逐个点亮7~0
uchar code mie0_7[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00}; // 逐个灭0~7
uchar 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);//顺时逐个同步亮
c语言教学视频推荐void nztl(uint t,uchar a);//逆时逐个同步亮
void sztm(uint t,uchar a);//顺时逐个同步灭
void nztm(uint t,uchar a);//逆时逐个同步灭
koeitecmo文件夹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;j
{
P0=P1=P2=P3=0x00;
P0=0x01;
delay(t);
for(i=0;i<7;i++)
{
P0=liang0_7[i+1];
P3=liang7_0[i];
delay(t);
}matlab如何实现傅里叶变换
P3=0xff;P1=0x01;
delay(t);
for(i=0;i<7;i++)
{
P1=liang0_7[i+1];
P2=liang7_0[i];
delay(t);
}
P2=0xff;delay(t);
}
}
汇编语言简单指令void qs(uint t,uchar a) //全部闪烁
{
uchar j;
for(j=0;jspringboot配置原理面试题
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论