您的位置 首页 技术

玩转LED点阵之一:16X64单红点阵静态显现

单片机:STC89C52晶振:221184M显示屏:HUB08接口16X64单红点阵显示方式:静态16X16汉字作者:huqinQQ:1766135164网址:h

//单片机STC89C52

//晶振:22.1184M
//显现屏:HUB08接口16X64单红点阵
//显现方法:静态16X16汉字
//作者:huqin
//QQ: 1766135164
//网址:http://www.51hei.com
//时刻:2013-05-13
#include
#include”zimo.h”
sbit SDAR1=P0^4; //赤色数据1
sbit SDAR2=P3^3; //赤色数据2
sbit SDAG1=P3^4; //绿色数据1
sbit SDAG2=P3^5; //绿色数据2
sbit CLK=P0^7;//74HC595的时钟
sbit STB=P0^6;//输出锁存
sbit OE=P0^5;//74HC138的使能

//74HC595串行数据输入
void SendDate(unsigned char DataR1,unsigned char DataG1,unsigned char DataR2,unsigned char DataG2)
{
unsigned char i;
for(i = 0; i < 8; i++)
{
SDAR1=DataR1 & 0x01;
SDAG1=DataG1 & 0x01;
SDAR2=DataR2 & 0x01;
SDAG2=DataG2 & 0x01;
CLK = 0;
CLK = 1;
DataR1 >>= 1;
DataG1 >>= 1;
DataR2 >>= 1;
DataG2 >>= 1;
}
}

//主函数进口
void main()
{
unsigned int num;
SDAR1=0;
SDAR2=0;
SDAG1=0;
SDAG2=0;

while(1)
{
for(num=0;num<16;num++)
{
SendDate(~Table[num*2+0],~0X00,~0x00,~0X00);
SendDate(~Table[num*2+1],~0X00,~0x00,~0X00);
SendDate(~Table[num*2+0+32],~0X00,~0x00,~0X00);
SendDate(~Table[num*2+1+32],~0X00,~0x00,~0X00);

SendDate(~Table[num*2+0+64],~0X00,~0x00,~0X00);
SendDate(~Table[num*2+1+64],~0X00,~0x00,~0X00);
SendDate(~Table[num*2+0+96],~0X00,~0x00,~0X00);
SendDate(~Table[num*2+1+96],~0X00,~0x00,~0X00);
OE=1;
STB=1;//输出锁存
STB=0;
P0=num;//16位行选
OE=0;
}
}
}

zimo.h

unsigned char code Table[]={ //取模宋体
0x08,0x00,
0xC8,0x7F,
0x48,0x00,
0x7F,0x00,
0x48,0x3F,
0x68,0x00,
0xD8,0x7F,
0x48,0x03,
0x4C,0x25,
0x4B,0x65,
0x48,0x19,
0x48,0x11,
0x28,0x11,
0x28,0x65,
0x1A,0x23,
0x04,0x01,

0xFC,0x1F,
0x00,0x0C,
0x60,0x03,
0x80,0x00,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0x84,0x10,
0x84,0x14,
0x04,0x08,

0x80,0x00,
0x80,0x00,
0x80,0x00,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x84,0x10,
0x84,0x10,
0xFC,0x1F,
0x84,0x10,
0x80,0x40,
0x80,0x40,
0x00,0x7F,
0x00,0x00,

0x00,0x00,
0xFC,0x0F,
0x00,0x04,
0x00,0x02,
0x00,0x01,
0x80,0x00,
0x80,0x00,
0x80,0x20,
0xFF,0x7F,
0x80,0x00,
0x80,0x00,
0x80,0x00,
0x80,0x00,
0x80,0x00,
0xA0,0x00,
0x40,0x00,
};

实际效果:

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/xinpin/jishu/318048.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部