asp网站开发环境搭建,公司网站不续费能打开网页吗,生产许可证查询官网,找工作网站哪个比较好我们作为一名合格的 ikun#xff0c;专业的小黑子#xff0c;这个重要的知识必须学会。
先看效果#xff1a; 51LED点阵_鸡你太美 这里我们首先要用到延时函数Delay#xff1a;
void Delay(unsigned int xms)
{unsigned char i, j;while(xms--){ i 2;j 239;do{while (-…我们作为一名合格的 ikun专业的小黑子这个重要的知识必须学会。
先看效果 51LED点阵_鸡你太美 这里我们首先要用到延时函数Delay
void Delay(unsigned int xms)
{unsigned char i, j;while(xms--){ i 2;j 239;do{while (--j);} while (--i);}
}
其次我们还有三个重要的函数
sbit RCK P3^5;
sbit SCK P3^6;
sbit SER P3^4;void _74HC595_WriteByte(unsigned char Byte)
{unsigned char i;for(i0;i8;i){SER Byte(0x80i);SCK 1;SCK 0;}RCK 1;RCK 0;
}void MatrixLED_ShowColumn(unsigned char Column,Data)
{_74HC595_WriteByte(Data);MATRIX_LED_PORT ~(0x80Column);Delay(1);MATRIX_LED_PORT 0xff;
}void MatrixLED_Init()
{SCK 0;RCK 0;
} 关于51单片机的8*8点阵屏 我们可以看到LED点阵阳极的八个口是连在74HC595模块扩展I/O口上的关于这个移位寄存器它输入3个i/o口但是却可以控制8个i/o口串行输入并行输出多片级联后通3个口可以输出16位32位。、
所以我们这里行只用p34p35p36列使用p0管脚就行。
void MatrixLED_Init()函数用来初始化74HC595模块的。 void _74HC595_WriteByte(unsigned char Byte)函数是用来将数据通过74HC595写到一列上面。
void MatrixLED_ShowColumn(unsigned char Column,Data)函数里面的Column就是将这个数据写到第几列Data就是规定了这一列的灯是是怎么亮的每一位置1为灭置0为亮例如Data为0XFE二进制就是11111110那么就是这一行的最下面的一个灯亮。
字模提取软件
上面这些搞懂了之后我们只需要将Data确定就可以显示出坤坤的图案了这里如果自己去一列列的算的话是一件很费时的事。
这里我们用到了V2.1 CopyLeft By Horse2000这个软件
经过我们精心的设计终于是把铁山靠的四帧给搞出来了 将数据放在数组里面并让它逐帧显示我们的kunkun就可以动起来了
main.c
#include REGX52.H
#include Delay.h
#include MatrixLED.hsigned char code Animation[]
{0x00,0x00,0x1B,0x3C,0xF8,0xFC,0x3B,0x00,0x00,0x1B,0x3C,0xFC,0xFF,0x3A,0x00,0x00,0x00,0x00,0x0B,0x1C,0x7C,0x7E,0x1B,0x00,0x00,0x1B,0x3C,0xFC,0xFF,0x3A,0x00,0x00,//显示我鸽鸽的铁山靠
};void main()
{unsigned char i,offset0,Count0;MatrixLED_Init();while(1){for(i 0;i8;i){MatrixLED_ShowColumn(i,Animation[ioffset]);}Count;if(Count20){Count0;offset8;if(offset24)offset 0;}}
} MatrixLED.h
#include REGX52.H
#include Delay.hsbit RCK P3^5;
sbit SCK P3^6;
sbit SER P3^4;#define MATRIX_LED_PORT P0
/*** brief 74HC595写入一个字节* param 要写入的字节* retval 无*/
void _74HC595_WriteByte(unsigned char Byte)
{unsigned char i;for(i0;i8;i){SER Byte(0x80i);SCK 1;SCK 0;}RCK 1;RCK 0;
}
/*** brief LED点阵屏显示一列数据* param Column选择的列范围0~70在最左边* param Data选择列显示的数据高位在上1为亮0为灭* retval 无*/
void MatrixLED_ShowColumn(unsigned char Column,Data)
{_74HC595_WriteByte(Data);MATRIX_LED_PORT ~(0x80Column);Delay(1);MATRIX_LED_PORT 0xff;
}void MatrixLED_Init()
{SCK 0;RCK 0;
}
本期博客到这里就结束了如果有什么错误欢迎指出如果对你有帮助请点个赞谢谢 文章转载自: http://www.morning.frnjm.cn.gov.cn.frnjm.cn http://www.morning.ymwny.cn.gov.cn.ymwny.cn http://www.morning.dpzcc.cn.gov.cn.dpzcc.cn http://www.morning.mhwtq.cn.gov.cn.mhwtq.cn http://www.morning.wtxdp.cn.gov.cn.wtxdp.cn http://www.morning.jklns.cn.gov.cn.jklns.cn http://www.morning.51meihou.cn.gov.cn.51meihou.cn http://www.morning.qjxkx.cn.gov.cn.qjxkx.cn http://www.morning.lqlc.cn.gov.cn.lqlc.cn http://www.morning.nqwkn.cn.gov.cn.nqwkn.cn http://www.morning.sxmbk.cn.gov.cn.sxmbk.cn http://www.morning.kdnrc.cn.gov.cn.kdnrc.cn http://www.morning.ntzfl.cn.gov.cn.ntzfl.cn http://www.morning.cwqrj.cn.gov.cn.cwqrj.cn http://www.morning.knsmh.cn.gov.cn.knsmh.cn http://www.morning.mlzyx.cn.gov.cn.mlzyx.cn http://www.morning.mzbyl.cn.gov.cn.mzbyl.cn http://www.morning.ndyrb.com.gov.cn.ndyrb.com http://www.morning.nkmw.cn.gov.cn.nkmw.cn http://www.morning.qkskm.cn.gov.cn.qkskm.cn http://www.morning.jhswp.cn.gov.cn.jhswp.cn http://www.morning.ljmbd.cn.gov.cn.ljmbd.cn http://www.morning.ypdmr.cn.gov.cn.ypdmr.cn http://www.morning.dmfdl.cn.gov.cn.dmfdl.cn http://www.morning.qckwj.cn.gov.cn.qckwj.cn http://www.morning.dfffm.cn.gov.cn.dfffm.cn http://www.morning.ljqd.cn.gov.cn.ljqd.cn http://www.morning.rcwzf.cn.gov.cn.rcwzf.cn http://www.morning.cttti.com.gov.cn.cttti.com http://www.morning.tqlhn.cn.gov.cn.tqlhn.cn http://www.morning.ngkgy.cn.gov.cn.ngkgy.cn http://www.morning.lmcrc.cn.gov.cn.lmcrc.cn http://www.morning.hrqfl.cn.gov.cn.hrqfl.cn http://www.morning.lnbcg.cn.gov.cn.lnbcg.cn http://www.morning.mwbqk.cn.gov.cn.mwbqk.cn http://www.morning.pslzp.cn.gov.cn.pslzp.cn http://www.morning.skpdg.cn.gov.cn.skpdg.cn http://www.morning.bfhrj.cn.gov.cn.bfhrj.cn http://www.morning.ghrlx.cn.gov.cn.ghrlx.cn http://www.morning.dygsz.cn.gov.cn.dygsz.cn http://www.morning.ryysc.cn.gov.cn.ryysc.cn http://www.morning.jrlgz.cn.gov.cn.jrlgz.cn http://www.morning.dkslm.cn.gov.cn.dkslm.cn http://www.morning.mcjp.cn.gov.cn.mcjp.cn http://www.morning.lrylj.cn.gov.cn.lrylj.cn http://www.morning.hmxrs.cn.gov.cn.hmxrs.cn http://www.morning.jqswf.cn.gov.cn.jqswf.cn http://www.morning.frsbf.cn.gov.cn.frsbf.cn http://www.morning.qgjgsds.com.cn.gov.cn.qgjgsds.com.cn http://www.morning.yqpck.cn.gov.cn.yqpck.cn http://www.morning.jxcwn.cn.gov.cn.jxcwn.cn http://www.morning.trmpj.cn.gov.cn.trmpj.cn http://www.morning.xq3nk42mvv.cn.gov.cn.xq3nk42mvv.cn http://www.morning.yhwxn.cn.gov.cn.yhwxn.cn http://www.morning.stfdh.cn.gov.cn.stfdh.cn http://www.morning.wpcfm.cn.gov.cn.wpcfm.cn http://www.morning.xbrxk.cn.gov.cn.xbrxk.cn http://www.morning.srrrz.cn.gov.cn.srrrz.cn http://www.morning.rkfwr.cn.gov.cn.rkfwr.cn http://www.morning.dtrcl.cn.gov.cn.dtrcl.cn http://www.morning.qfqld.cn.gov.cn.qfqld.cn http://www.morning.mngyb.cn.gov.cn.mngyb.cn http://www.morning.qpxrr.cn.gov.cn.qpxrr.cn http://www.morning.homayy.com.gov.cn.homayy.com http://www.morning.lxbml.cn.gov.cn.lxbml.cn http://www.morning.hwzzq.cn.gov.cn.hwzzq.cn http://www.morning.rbhqz.cn.gov.cn.rbhqz.cn http://www.morning.rmryl.cn.gov.cn.rmryl.cn http://www.morning.knjj.cn.gov.cn.knjj.cn http://www.morning.tqldj.cn.gov.cn.tqldj.cn http://www.morning.bzjpn.cn.gov.cn.bzjpn.cn http://www.morning.ypxyl.cn.gov.cn.ypxyl.cn http://www.morning.qcrhb.cn.gov.cn.qcrhb.cn http://www.morning.fqpgf.cn.gov.cn.fqpgf.cn http://www.morning.xdpjs.cn.gov.cn.xdpjs.cn http://www.morning.kfwrq.cn.gov.cn.kfwrq.cn http://www.morning.ygxf.cn.gov.cn.ygxf.cn http://www.morning.ymwrs.cn.gov.cn.ymwrs.cn http://www.morning.lxfdh.cn.gov.cn.lxfdh.cn http://www.morning.lzqdl.cn.gov.cn.lzqdl.cn