把你的51单片机设计的16*128点阵的LED显示器给我参考一下好吗, 追加50分。。帮帮忙,谢谢
展开全部
#include<reg52.h>
/////////////////////////////////////////////////////////////////////////
// 汉字字模表 //
// 汉字库: 宋体16.dot 横向取模右高位,数据排列:从左到右从上到下 //
/////////////////////////////////////////////////////////////////////////
unsigned char code hanzi[] = // 数据表
{
//-- 你 --
0x88,0x00,0x88,0x00,0x88,0x00,0xC4,0x3F,
0x44,0x20,0x26,0x10,0x15,0x02,0x04,0x02,
0x84,0x0A,0x84,0x12,0x44,0x32,0x24,0x22,
0x04,0x02,0x04,0x02,0x84,0x02,0x04,0x01,
//-- 好 --
0x08,0x00,0x88,0x3F,0x08,0x20,0x08,0x10,
0x3F,0x08,0x24,0x04,0x24,0x24,0xE4,0x7F,
0x24,0x04,0x22,0x04,0x14,0x04,0x08,0x04,
0x14,0x04,0x22,0x04,0x21,0x05,0x00,0x02,
//-- 吗 --
0x00,0x08,0xD0,0x1F,0x3E,0x08,0x92,0x08,
0x92,0x08,0x92,0x08,0x92,0x08,0x92,0x28,
0x92,0x7F,0x12,0x20,0x12,0x24,0xFE,0x2F,
0x12,0x20,0x00,0x20,0x00,0x28,0x00,0x10
};
unsigned char code lie[]={0xf0,0xf8,0xf1,0xf9,0xf2,0xfa,0xf3,0xfb,0xf4,
0xfc,0xf5,0xfd,0xf6,0xfe,0xf7,
0xff};//扫描使用的位码,是控制74hc154的
void yanshi(unsigned char ms);//延时程序
void main()//主程序
{
unsigned char k,i,m;
P0=0xff;
while(1)
{
for(k=0;k<3;k++)//三个字,所以循环显示3次
{
for(m=0;m<20;m++)//每个字延时一段时间
{P2=0x00;//给端口清零,这一部很重要,没有这个语句,显示有乱比划
P1=0x00;//同上
for(i=0;i<16;i++)//上半屏
{
P0=lie[i];//位码16个
P1=hanzi[k*32+i];//半屏段码也是16个,由k控制
yanshi(2);
}
P2=0x00;
P1=0x00;
for(i=16;i<32;i++)//下半屏
{
P0=lie[i-16];
P2=hanzi[k*32+i];
yanshi(1);
}
}
}
}
}
void yanshi(unsigned char ms)
{
unsigned char i;
while(ms--)for(i=0;i<124;i++);
}
16*16点阵
/////////////////////////////////////////////////////////////////////////
// 汉字字模表 //
// 汉字库: 宋体16.dot 横向取模右高位,数据排列:从左到右从上到下 //
/////////////////////////////////////////////////////////////////////////
unsigned char code hanzi[] = // 数据表
{
//-- 你 --
0x88,0x00,0x88,0x00,0x88,0x00,0xC4,0x3F,
0x44,0x20,0x26,0x10,0x15,0x02,0x04,0x02,
0x84,0x0A,0x84,0x12,0x44,0x32,0x24,0x22,
0x04,0x02,0x04,0x02,0x84,0x02,0x04,0x01,
//-- 好 --
0x08,0x00,0x88,0x3F,0x08,0x20,0x08,0x10,
0x3F,0x08,0x24,0x04,0x24,0x24,0xE4,0x7F,
0x24,0x04,0x22,0x04,0x14,0x04,0x08,0x04,
0x14,0x04,0x22,0x04,0x21,0x05,0x00,0x02,
//-- 吗 --
0x00,0x08,0xD0,0x1F,0x3E,0x08,0x92,0x08,
0x92,0x08,0x92,0x08,0x92,0x08,0x92,0x28,
0x92,0x7F,0x12,0x20,0x12,0x24,0xFE,0x2F,
0x12,0x20,0x00,0x20,0x00,0x28,0x00,0x10
};
unsigned char code lie[]={0xf0,0xf8,0xf1,0xf9,0xf2,0xfa,0xf3,0xfb,0xf4,
0xfc,0xf5,0xfd,0xf6,0xfe,0xf7,
0xff};//扫描使用的位码,是控制74hc154的
void yanshi(unsigned char ms);//延时程序
void main()//主程序
{
unsigned char k,i,m;
P0=0xff;
while(1)
{
for(k=0;k<3;k++)//三个字,所以循环显示3次
{
for(m=0;m<20;m++)//每个字延时一段时间
{P2=0x00;//给端口清零,这一部很重要,没有这个语句,显示有乱比划
P1=0x00;//同上
for(i=0;i<16;i++)//上半屏
{
P0=lie[i];//位码16个
P1=hanzi[k*32+i];//半屏段码也是16个,由k控制
yanshi(2);
}
P2=0x00;
P1=0x00;
for(i=16;i<32;i++)//下半屏
{
P0=lie[i-16];
P2=hanzi[k*32+i];
yanshi(1);
}
}
}
}
}
void yanshi(unsigned char ms)
{
unsigned char i;
while(ms--)for(i=0;i<124;i++);
}
16*16点阵
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询