永发信息网

求毕业论文 题目 基于单片机的中文显示 那位高手帮下忙哈!!!!!!!!

答案:1  悬赏:10  手机版
解决时间 2021-07-20 11:09

师兄师姐们 帮下忙哈

最佳答案

用lcd液晶显示图片文字数字


lcd显示:hs12864-15c液晶用并口显示


#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
#define Lcd_IO P0
#define comm 0
#define dat 1


sbit RS=P2^0;
sbit RW=P2^1;
sbit EN=P2^2;
sbit PSB=P2^3;
sbit RST=P2^4;


//一幅图形数据
uchar code Lcd_num[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x80,0x00,0x0F,0xFF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0C,0x43,0x01,0x80,0x00,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x19,0xFF,0x07,0x00,0x07,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x3F,0xFC,0x1E,0x00,0x1F,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xBF,0xFF,0xFC,0x00,0x7F,0xFC,0x00,0x7F,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xFF,0xFF,0xF0,0x00,0xFF,0xC0,0x00,0x0F,0xE0,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xFF,0xFF,0xE0,0x03,0xFF,0xFF,0xFC,0x01,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xDF,0xFF,0xC0,0x07,0xFF,0xFF,0xFF,0x80,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0xFF,0xFF,0x00,0x0F,0xFF,0xFF,0xFF,0xE0,0x38,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xFF,0xF8,0x00,0x1F,0xFF,0xF0,0x03,0xF8,0x38,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xFF,0xE0,0x00,0x3F,0xFF,0xFF,0xC0,0x7C,0x18,0x00,0x00,0x00,
0x00,0x00,0x00,0x04,0x7F,0xF0,0x00,0x3F,0xFF,0xFF,0xF8,0x1E,0x08,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xFF,0xF8,0x00,0x7F,0xFF,0xFF,0xFE,0x0F,0x08,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0xFF,0xFC,0x00,0xFF,0xFF,0xFF,0xFF,0x87,0x08,0x00,0x00,0x00,
0x00,0x00,0x00,0x1F,0xFF,0xFE,0x00,0xFF,0xFF,0xFF,0xFF,0x83,0x88,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0xFF,0xFE,0x01,0xFF,0xFF,0xFF,0xFF,0xC3,0x88,0x00,0x00,0x00,
0x00,0x00,0x00,0x7F,0xFF,0xFE,0x01,0xFF,0xFF,0xFF,0xFF,0xE1,0x88,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xFF,0xFE,0x03,0xFF,0xFF,0xFF,0xFF,0xE1,0x88,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFE,0x03,0xFF,0xFF,0xFF,0xFF,0xF1,0x88,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFE,0x03,0xFF,0xFF,0xFF,0xFF,0xF3,0x08,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0xF2,0x10,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFF,0x8F,0xFF,0xFF,0xFF,0xFF,0xF0,0x20,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x70,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0x7F,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0x7F,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0x7E,0x20,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0x3E,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xCF,0xFF,0x3C,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xCF,0xFE,0x38,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0x8F,0xFE,0x38,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0x8F,0xFE,0x30,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x1F,0x7C,0x20,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFE,0x1E,0x78,0x00,0x40,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFE,0x1E,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xDA,0x3C,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xF2,0x30,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xF1,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFE,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x7C,0x3F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x78,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x72,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x40,0x04,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x02,0x0C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x02,0x40,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x0C,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x38,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0xE2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};


void Delay_us(uint i)//i=10,time=100us
{
for(;i>0;i--);
}



void Delay_ms(uint i)//i=10,time=10ms
{
while(i--)
Delay_us(100);
}



//向12864液晶写数据或命令
void Lcd_wcd(uchar dat_comm,uchar Lcd_data)
{
if(dat_comm)
RS=1; //数据
else RS=0; //命令
Lcd_IO=Lcd_data;
RW=0;
EN=1;
Delay_us(30);
EN=0;
}



void Lcd_init() //液晶初始化
{
RST=0;
Delay_us(10); //外部复位
RST=1;
PSB=1;
Lcd_wcd(comm,0x30); //基本指令格式
Delay_us(30);
Lcd_wcd(comm,0x01); //液晶清屏
Delay_ms(30);
Lcd_wcd(comm,0x06); //设置显示格式,光标位置
Lcd_wcd(comm,0x0c);
}



void Lcd_pst(uchar xx,uchar yy) //设置显示坐标
{
uint line;
switch(yy)
{
case 0:line=0x00;break;
case 1:line=0x10;break;
case 2:line=0x08;break;
case 3:line=0x18;break;
default :break;
}
Lcd_wcd(comm,0x80+line+xx);
}


void Lcd_str(uchar *str) //显示字符串和汉字
{
while(*str!='\0')
{
Lcd_wcd(dat,*str);
str++;
}
}



//液晶自定义显示
void Lcd_define(uchar *str)
{
uint m,n;
Lcd_wcd(comm,0x34); //设置位扩展指令格式
for(m=0;m<32;m++)
{
for(n=0;n<8;n++)
{
Lcd_wcd(comm,0x80+m); //写纵坐标,00H--1FH
Lcd_wcd(comm,0x80+n); //写横坐标,00H--07H
Lcd_wcd(dat,str[m*16+n*2]);
Lcd_wcd(dat,str[m*16+n*2+1]);//连续写两个数据
}
}


for(m=32;m<64;m++)
{
for(n=0;n<8;n++)
{
Lcd_wcd(comm,0x80+m-32); //写纵坐标,00H--1FH
Lcd_wcd(comm,0x88+n); //写横坐标,08H--0FH
Lcd_wcd(dat,str[m*16+n*2]);
Lcd_wcd(dat,str[m*16+n*2+1]); //连续写两个数据
}
}
Lcd_wcd(comm,0x30); //基本指令格式
Lcd_wcd(comm,0x01); //清屏
Delay_ms(30);
Lcd_wcd(comm,0x34); //扩展指令格式
Lcd_wcd(comm,0x36); //显示自定义图形
}



//主函数
void main()
{
P0=0xff;
P2=0xff;
Lcd_init();
Lcd_pst(0,0);
Lcd_str("狼子电雪工作室");
Lcd_pst(0,1);
Lcd_str(" 微笑 自信");
Lcd_pst(0,2);
Lcd_str(" 谦虚 自律");
Delay_ms(1000);
Lcd_define(Lcd_num);
while(1);
}

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
来人呀帮忙呀
有谁吃饭是用鼻子吃?
兑换福袋活动什么时候结束
请问哪位朋友是湖南省。长沙市。宁乡县。龙田
眼部的细纹怎么解决
我觉得我们俩很适合,而且他也很有潜力,但父
农业银行支行怎么查询,农业银行怎么查询自己
课题名称:数控加工中心刀库结构及功能的研究
胃出血医的好吗?
关于人的性格的名言,关于人物性格形象的诗句
为什么玩DNF的时候会突然卡下好了以后又卡下
安岳离成都有多少公里,成都至罗江县高速收费
请问遵义市第一中学初中部的校长和教导处主任
倚天屠龙记(苏有朋版)中张三丰出场时背景音乐
吴奇隆的哪些歌曲好听?
推荐资讯
丝路英雄 会不会灭
哪位帮帮忙找下都市生活完结小说
路飞海贼王放到多少级了?
爲什麽越想創些事業怎麽越覺得難呢?沒本錢改
声音之类的问题
网赚到底是真的还是假的!
用英语翻译;我们的衣服也会很臭烟味如果你抽
做人/要做什么样的人/才最开心呢/
知了什么时候有,有一句歌词是什么时候回来在
对没有结果的爱情我选择放弃,我错了吗?
当我财付通没钱了腾讯公益图标会熄灭吗?或是
问问 6级有什么功能?
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?