12864液晶显示程序(图案+文字)
12864基本显示程序
/******************************************************************/
/* 液晶初始化-图形 */
/******************************************************************/
{
int i,j;
//*******显示上半屏内容设置
for(i=0;i<32;i++) //
{
lcd_wdat((0x80 + i),0); //SET 垂直地址 VERTICAL ADD
lcd_wdat(0x80,0); //SET 水平地址 HORIZONTAL ADD
for(j=0;j<16;j++)
lcd_wdat(0x00,1);
delay(1);
}
lcd_wdat(0x36,0); //写完数据,开图形显示
}
//反白,X值为0-7,Y值为0-3,width为行反白格数
void photodisplay(uchar x,uchar y,uchar width)
}
/******************************************************************/
/* 液晶初始化-字库 */
/******************************************************************/
delay(100);
lcd_wdat(0x10,0);
delay(100);
带字库12864液晶显示程序
#include <reg52.h>#include <intrins.h>#define uint unsigned int#define uchar unsigned char#define LCDdata P0//采用并行模式sbit E = P2^7;sbit RW = P2^6;sbit RS = P2^5;sbit RST = P2^4;sbit key1 = P2^0; //时、分、秒选择键sbit key2 = P2^1; //加一键sbit key3 = P2^2; //减一键void init();//void check_busy();void delayms(uint x);void write_com(uchar com);void write_data(uchar date);//void delay(uchar y);void t_bcd();void disp_time();void t_time();uchar code string[]={"00时00分00秒"}; uchar code tab[] ={"长春工业大学"}; uchar code tab1[]={"人文信息学院"}; uchar code tab2[]={"electronic 沈琦"};uchar time[6];//显示缓冲区uchar count;char sec,min,hour;//--------------主函数-----------------void main(){init();while(1){if(count == 200){count = 0;sec++;if(sec == 60){sec = 0;min++;if(min == 60){min = 0;hour++;if(hour == 24){hour = 0;}}}t_bcd();disp_time();}t_time();}}//-------------初始化----------------void init(){uchar i;// RST = 0;// delayms(1);// RST = 1;// delayms(40);write_com(0x30);write_com(0x0f);write_com(0x01);write_com(0x81);for(i=0;i<12;i++){write_data(string[i]);delayms(5);}write_com(0x90);for(i=0;i<16;i++){write_data(tab[i]);delayms(5);}write_com(0x8a);for(i=0;i<12;i++){write_data(tab1[i]);delayms(5);}write_com(0x98);for(i=0;i<16;i++){write_data(tab2[i]);delayms(5);}TMOD = 0x01;TH0 = (65536-5000)/256;TL0 = (65536-5000)%256;EA = 1;ET0 = 1;TR0 = 1;write_com(0x0c);}//------------毫秒延时--------------- void delayms(uint x){uchar i;while(x--){for(i=0;i<120;i++);}}/*//--------------判忙程序--------------- void check_busy(){// LCDdata = 0xff;RS = 0;RW = 1;// E = 0;E = 1;LCDdata = 0xff;while(LCDdata&0x80);E = 0;}*///------------写命令----------------- void write_com(uchar com){// check_busy();RS = 0;RW = 0;E = 0;LCDdata = com;// delayms(5);E = 1;delayms(5);E = 0;}//-------------写数据------------------ void write_data(uchar date){// check_busy();RS = 1;RW = 0;E = 0;LCDdata = date;// delayms(5);E = 1;delayms(5);E = 0;}//-----------定时中断0------------- void timer0() interrupt 1{TH0 = (65536-5000)/256;TL0 = (65536-5000)%256;count++;}void t_bcd(){time[0] = sec%10;time[1] = sec/10;time[2] = min%10;time[3] = min/10;time[4] = hour%10;time[5] = hour/10;}//--------------时钟时间显示----------------- void disp_time(){write_com(0x85);write_data(0x30+time[1]);write_data(0x30+time[0]);write_com(0x83);write_data(0x30+time[3]);write_data(0x30+time[2]);write_com(0x81);write_data(0x30+time[5]);write_data(0x30+time[4]);}//------------调整时间程序--------------- void t_time(){static uchar num;if(key1 == 0){delayms(5);while(!key1);TR0 = 0;num++;}//-----------------调时-----------------if(num == 1){write_com(0x81);write_com(0x0f);if(key2 == 0){delayms(5);if(key2 == 0){while(!key2);hour++;if(hour == 24){hour = 0;}t_bcd();write_data(0x30+time[5]);write_data(0x30+time[4]);}}if(key3 == 0){delayms(5);if(key3 == 0){while(!key3);hour--;if(hour == -1){hour = 23;}t_bcd();write_data(0x30+time[5]);write_data(0x30+time[4]);}}}//-----------------调分----------------------if(num == 2){write_com(0x83);if(key2 == 0){delayms(5);if(key2 == 0){while(!key2);min++;if(min == 60){min = 0;}t_bcd();write_data(0x30+time[3]);write_data(0x30+time[2]);}}if(key3 == 0){delayms(5);if(key3 == 0){while(!key3);min--;if(min == -1){min = 59;}t_bcd();write_data(0x30+time[3]);write_data(0x30+time[2]);}}}//---------------调秒------------------if(num == 3){write_com(0x85);if(key2 == 0){delayms(5);if(key2 == 0){while(!key2);sec++;if(sec == 60){sec = 0;}t_bcd();write_data(0x30+time[1]);write_data(0x30+time[0]);}}if(key3 == 0){delayms(5);if(key3 == 0){while(!key3);sec--;if(sec == -1){sec = 59;}t_bcd();write_data(0x30+time[1]);write_data(0x30+time[0]);}}}//---------------退出调整时间----------------- if(num == 4){num = 0;write_com(0x0c);TR0 = 1;}}。
12864汉字液晶显示驱动程序
12864汉字液晶显示驱动程序模块主要硬件构成说明接口说明*注释1:如在实际应用中仅使用串口通讯模式,可将PSB接固定低电平,也可以将模块上的J8和“GND”用焊锡短接。
*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。
*注释3:如背光和模块共用一个电源,可以将模块上的JA、JK用焊锡短接。
2.2并行接口管脚号管脚名称电平管脚功能描述1 VSS 0V 电源地2 VCC 3.0+5V 电源正3 V0 - 对比度(亮度)调整RS=“H”,表示DB7——DB0为显示数据4RS(CS)H/LRS=“L”,表示DB7——DB0为显示指令数据R/W=“H”,E=“H”,数据被读到DB7——DB0 5R/W(SID) H/LR/W=“L”,E=“H→L”, DB7——DB0的数据被写到IR或DR6 E(SCLK) H/L 使能信号7 DB0 H/L 三态数据线8 DB1 H/L 三态数据线9 DB2 H/L 三态数据线10 DB3 H/L 三态数据线11 DB4 H/L 三态数据线12 DB5 H/L 三态数据线13 DB6 H/L 三态数据线14 DB7 H/L 三态数据线15 PSB H/L H:8位或4位并口方式,L:串口方式(见注释1)16 NC - 空脚17 /RESET H/L 复位端,低电平有效(见注释2)18 VOUT - LCD驱动电压输出端19 A VDD 背光源正端(+5V)(见注释3)20 K VSS 背光源负端(见注释3)*注释1:如在实际应用中仅使用并口通讯模式,可将PSB接固定高电平,也可以将模块上的J8和“VCC”用焊锡短接。
*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。
*注释3:如背光和模块共用一个电源,可以将模块上的JA、JK用焊锡短接。
控制器接口信号说明:1、RS,R/W的配合选择决定控制界面的4种模式:2、E信号● 忙标志:BF BF标志提供内部工作情况.BF=1表示模块在进行内部操作,此时模块不接受外部指令和数据.BF=0时,模块为准备状态,随时可接受外部指令和数据. 利用STATUS RD 指令,可以将BF读到DB7总线,从而检验模块之工作状态.● 字型产生ROM(CGROM)字型产生ROM(CGROM)提供8192个此触发器是用于模块屏幕显示开和关的控制。
LCD12864显示中文及图片C程序
/****************************************屏幕显示驱动*****************************************/#include "GT23L24T3Y.h"#include "print.h"#include <stdio.h>#include <string.h>#include "bmp_picture.h"#include "lcd_12864.h"#include "..\user\rtc.h"u8 comTable[]={4,5,6,7,3,2,1,0};extern void Setlcd_Addr ( u8 row,u8 column );//外部函数调用声明extern u8 Num_Code[];//字库获得函数extern u8 Big_Num_Code[];//字库获得函数extern u8 Picture_Code[];//字库获得函数extern u8 arrow1[];extern u8 arrow2[];u8 testlcd[]="测试数据";/************************************************************************//显示中文输出//函数名:print_16//功能:显示16x16点阵字符串。
// 函数名:print_16// 功能:显示16点阵字符串// 形参:// row:x轴// column:y轴// *lcd:显示字符串// logic:显示取反// wei.显示位值// len长度*************************************************************************/void _print_15 ( u8 row,u8 column,const char *lcd,u8 logic ,u8 wei,u8 len){u8 w=0,x=0,y=0,l=0,read_data=0;u8 Length=0;GT_cs1;//字库片选至高for ( l=len; l>0; l=l-2 ) //总字节{w=*lcd;if ( w&0x80 ) //为1则为汉字,为0则为ASCII码{GT_cs0; //字库片选选定GT23_Write ( GT23_write_15 ( lcd ) ); //写入字库指令以及文字地址for ( x=0; x<2; x++ ){Setlcd_Addr (row,column);for(y=0;y<16;y++){read_data=GT23_Read();if(logic == true){// read_data = ~read_data;}WriteData(read_data );}row++;}GT_cs1;//字库片选至高row-=2;column+=16;if(column>=128){row+=2;column=0;}lcd=lcd+2;}}}/************************************************************************//描述:显示中文输出//使用:顶层函数调用参数:row 行column 列*lcd 字符串logic 反白*************************************************************************/ void print_15 ( u8 row,u8 column,const char *lcd,u8 logic ){u8 c=strlen ( lcd );_print_15(row,column,lcd,logic,0,c);}/************************************************************************ //描述:显示图片输出//使用:顶层函数调用参数:row 行column 列*lcd 字符串logic 反白*************************************************************************/ void print_array(u16 row,u16 column,u16 size_x,u16 size_y,const u8 *ptr, u8 logic){u8 w=0,x=0,y=0,l=0,read_data=0;u8 Length=0;for( x=0;x<size_x/8;x++){Setlcd_Addr (row,column);for(y=0;y<size_y;y++){read_data=*( ptr + (y+x*size_y) );if(logic == true){read_data = ~read_data;}WriteData1(read_data);// WriteData1(0XFF);}row++;}}u8 OpMgsCode[][10] ={"病人信息","循环播放","房号与床号","从机音量","对比度","广播""恢复","音乐","主机音量","时间"};u8 DayCode[][7]={"星期天","星期一","星期二","星期三","星期四","星期五","星期六"};void PrintMainFace(time mytime,u8 PeopleNum){//待机界面函数u8 Hrd,Ten,One;Lcd_Clr();//清屏print_15 ( 0,16, "月",false );print_15 ( 0,48, "日",false );print_15 ( 0,70, &DayCode[mytime.day][0],false );//显示星期//日期显示Ten=mytime.month/10;One=mytime.month%10;print_array(0 , 0, 16 , 7 , &Num_Code[Ten*14], false);print_array(0 , 8, 16 , 7 , &Num_Code[One*14], false);Ten=mytime.date/10;One=mytime.date%10;print_array(0 , 32, 16 , 7 , &Num_Code[Ten*14], false);print_array(0 , 40, 16 , 7 , &Num_Code[One*14], false);//时间显示Ten=mytime.hour/10;One=mytime.hour%10;print_array(2 , 20, 32 , 21 , &Big_Num_Code[Ten*84], false);print_array(2 , 42, 32 , 21 , &Big_Num_Code[One*84], false);Ten=mytime.minute/10;One=mytime.minute%10;print_array(2 , 68, 32 , 21 , &Big_Num_Code[Ten*84], false);print_array(2 , 90, 32 , 21 , &Big_Num_Code[One*84], false);//住院人数显示print_15 ( 6,32, "住院人数",false );Hrd=PeopleNum/100;PeopleNum=PeopleNum%100;Ten=PeopleNum/10;One=PeopleNum%10;if(Hrd ){print_array(6 , 96, 16 , 7 , &Num_Code[Hrd*14], false);}print_array(6 , 102, 16 , 7 , &Num_Code[Ten*14], false);print_array(6 , 110, 16 , 7 , &Num_Code[One*14], false);}void PrintPictureFace(u8 Index){time mytime;Lcd_Clr();//清屏mytime.month = 10;mytime.date = 16;mytime.hour = 12;mytime.minute = 15;mytime.day =3;PrintMainFace(mytime,96);//print_array(0 , 10, 48 , 8 , arrow1, false);//左箭头显示// print_array(0,38 ,48 ,48 , &Picture_Code[288*Index], false);//图片显示// print_array(0,108, 48 , 8 , arrow2, false); //右箭头显示//print_15 ( 6,33, &OpMgsCode[0][Index],false );//提示信息显示}。
12864汉字液晶显示--按键电子时钟程序(具有闪烁,移位,加一,减一功能)
//12864汉字液晶显示--按键电子时钟程序(具有闪烁,移位,加一,减一功能)#include <reg52.h>#include <intrins.h>#define uchar unsigned charvoid lcd_ini();void ascii_change(void);void delay();void wri_add(uchar com);void wri_dat(uchar com1);void shan(void);void disp();void tkey(void);sbit cs=P1^7;sbit sid=P1^6;sbit sclk=P1^5;bit flag=1;uchar dat,count,f=1;//f测试哪个单元为当前闪烁状态uchar data clock[3]={23,45,12};uchar code clockname[10]={"北京时间:"};uchar data num[6];/*******主程序*************/void main(){lcd_ini();count=10;//机器周期为1us,每次定时50ms,此变量用来控制循环次数,在下面赋值为20,共定时1秒TMOD=0x01;TL0=0XB0;TH0=0X3C;EA=1;ET0=1;IT0=1;EX0=1;TR0=1;while(1){back:ascii_change();disp();delay();if(flag==1)goto back;tkey();shan();delay();}}/****lcd初始化*******/void lcd_ini(){wri_add(0x30);delay();wri_add(0x0c);delay();wri_add(0x01);delay();wri_add(0x06);delay();}/********定时程序*************/ void timer1() interrupt 1 using 2 {TL0=0XB0;TH0=0X3C;count--;if(count==0){count=10;clock[2]++;//秒//}elsegoto out;if(clock[2]==60){clock[2]=0;clock[1]++;//分//}if(clock[1]==60){clock[1]=0;clock[0]++;}if(clock[0]==24)//时//clock[0]=0;out:_nop_();}/*******十位个位转换成ASCII码************/ void ascii_change(void){num[5]=clock[2]-(clock[2]/10)*10+0x30;num[4]=clock[2]/10+0x30;num[3]=clock[1]-(clock[1]/10)*10+0x30;num[2]=clock[1]/10+0x30;num[1]=clock[0]-(clock[0]/10)*10+0x30;num[0]=clock[0]/10+0x30;}/********廷时程序*************/void delay(){uchar i,j;for (i=250;i>0;i--)for (j=250;j>0;j--);}/*****Write address*********/void wri_add(uchar com){uchar i,j,k;cs=0;cs=1;dat=0xf8;for(i=1;i<=8;i++){sid=(bit)(dat&0x80);sclk=0;sclk=1;sclk=0;dat=dat<<1;}dat=com;dat=dat&0xf0;for(j=1;j<=8;j++){sid=(bit)(dat&0x80);sclk=0;sclk=1;sclk=0;dat=dat<<1;}dat=com;dat=_cror_(dat,4);// 此为高低四位交换dat=dat&0xf0;for(k=1;k<=8;k++){sid=(bit)(dat&0x80);sclk=0;sclk=1;sclk=0;dat=dat<<1;}}/*********Write data*************/ void wri_dat(uchar com1){uchar i,j,k;cs=0;cs=1;dat=0xfa;for(i=1;i<=8;i++){sid=(bit)(dat&0x80);sclk=0;sclk=1;sclk=0;dat=dat<<1;}dat=com1;dat=dat&0xf0;for(j=1;j<=8;j++){sid=(bit)(dat&0x80);sclk=0;sclk=1;sclk=0;dat=dat<<1;}dat=com1;dat=_cror_(dat,4);// 此为高低四位交换dat=dat&0xf0;for(k=1;k<=8;k++){sid=(bit)(dat&0x80);sclk=0;sclk=1;sclk=0;dat=dat<<1;}}/******display program***********/ void disp(){uchar i,k=0;wri_add(0x80);for (i=1;i<=9;i++)wri_dat(clockname[i-1]);wri_add(0x90);for (i=1;i<=6;i++) {k++;if(k==3||k==5)wri_dat(clockname[8]);//时间之间的冒号。
12864点阵LCD液晶屏带中文字库
功能
令 RS R/W D7 D6 D5 D4 D3 D2 D1 D0
待命
进入待命模式,执行其他指令都棵终止
0 0 0 0000001
模式
待命模式
卷动地 SR=1:允许输入垂直卷动地址
址开关 0 0 0 0 0 0 0 0 1 SR SR=0:允许输入 IRAM 和 CGRAM 地址
开启
反白
选择 2 行中的任一行作反白显示,并可决定反白与否。初始值 R1R
0 0 0 0 0 0 0 1 R1 R0
选择
0=00,第一次设定为反白显示,再次设定变回正常
睡眠
SL=0:进入睡眠模式
0 0 0 0 0 0 1 SL X X
模式
SL=1:脱离睡眠模式
CL=0/1:4/8 位数据 扩充
RE=1: 扩充指令操作 功能 0 0 0 0 1 CL X RE G 0
RE=0: 基本指令操作 设定
示移位控 0 0 0 0 0 1 S/C R/L X X RAM 的内容
制
DL=0/1:4/8 位数据 功能
0 0 0 0 1 DL X RE X X RE=1: 扩充指令操作 设定
RE=0: 基本指令操作
设定 CG
RAM
0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0 设定 CGRAM 地址
G=1/0:绘图开关
设定
设定绘图 RAM
绘图 RA
0 0 0 AC3 AC2 AC1 AC0 先设定垂直(列)地址 AC6AC5…AC0
001
M
AC6 AC5 AC4 AC3 AC2 AC1 AC0 再设定水平(行)地址 AC3AC2AC1AC0
地址
将以上 16 位地址连续写入即可
12864程序
硬件连接方式是:并口直接访问。
这是汉字显示程序:#include<reg51.h>#include<absacc.h>#define uchar unsigned char#define datawr 0x1200 //写数据通道#define comwr 0x1000 //写控制命令通道#define datare 0x1300 //读数据通道#define comre 0x1100 //读忙通道uchar code disp_data[]={" 浙江大学" //第一行,第一页"04级通信工程一班" //第三行" 宁波理工学院" //第二行" 竞赛小组" //第四行"128X64液晶显示器" //第一行,第二页" 测试程序" //第三行" 07年07月25日" //第二行" Tornado "}; //第四行void set12864();void write_command(uchar command);void write_page(uchar data_add);void read_page(uchar data_add);void delays(uchar cont);void main(){while(1){set12864(); //初始化12864write_page(0); //写入一页数据read_page(0x30); //读出一页数据到内部RAMdelays(2); //延时2swrite_page(64); //写入下一页数据delays(2); //延时2s}}//初始化12864子程序void set12864(){write_command(0x30); //功能设定控制字write_command(0x0c); //显示开关控制字write_command(0x01); //清除屏幕控制字write_command(0x06); //进入设定点控制字}//写控制命令子程序void write_command(uchar command){bit flag=1; //12864空闲标志位while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[comwr]=command; //空闲传送控制字}//写一页子程序void write_page(uchar data_add){bit flag=1; //12864空闲标志位uchar num=64; //64个循环,连续写入32个汉字或是64个西文字符write_command(0x80);for(;num>0;num--){while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[datawr]=disp_data[data_add++]; //空闲传送数据}}//读一页子程序void read_page(uchar data_add){bit flag=1; //12864空闲标志位uchar num=64; //64个循环,连续写入32个汉字或是64个西文字符write_command(0x80);for(;num>0;num--){while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;DBYTE[data_add++]=XBYTE[datare]; //空闲传送数据}}//延时cont秒子程序void delays(uchar count){unsigned char h,i,j,k;do{for(h=5;h>0;h--)for(i=4;i>0;i--)for(j=116;j>0;j--)for(k=214;k>0;k--);}while(--count);}这是图象显示程序:#include<reg51.h>#include<absacc.h>#define uchar unsigned char#define uint unsigned int#define datawr 0x1200 //写数据通道#define comwr 0x1000 //写控制命令通道#define datare 0x1300 //读数据通道#define comre 0x1100 //读忙通道uchar code disp_data[] = // 数据表{0x00,0x01,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00 ,0x00,0x00,0x00,0x00,0x01,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00 ,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00 ,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00 ,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00 ,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00 ,0x00,0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F,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x07,0xA0,0x03,0xFC,0x00,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x05,0xC0,0x03,0xC8,0x00,0x7F, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x19,0x00,0x00,0x88,0x0C,0x07, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x0C,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0xC0, 0x7F,0xFF,0xFF,0xFF,0xFF,0xF8,0x07,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0 x0F,0xFF,0xFE,0xFF,0xFF,0xD0,0x07,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x0F, 0x03,0xFF,0xF8,0xFF,0xFC,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x3F,0xFF,0xC0,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0 x00,0xFF,0xF8,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0 x00,0x1F,0xFE,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x78,0x02,0x00,0x00,0x00,0x00,0 x00,0x0F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x78,0x00,0x00,0x00,0x00,0 x00,0x02,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00, 0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00, 0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0x00,0x00,0x00,0x00,0 x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x27,0xC0,0x00,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x01};void set12864();void setxy(uchar x,uchar y);void write_command(uchar command);void write_16byte(uint data_add);void delays(uchar count);void main(){uchar x,y,i;while(1){y="0x80"; //设置液晶上半部分坐标x="0x80";delays(2); //延时2sset12864(); //初始化12864delays(2);for(i=0;i<32;i++) //写入液晶上半图象部分{ //写入坐标setxy(x,y);write_16byte(i*16); //连续写入16字节数据y++; //y轴地址加1}y="0x80"; //设置液晶下半部分坐标x="0x88";for(i=0;i<32;i++) //写入液晶下半图象部分{setxy(x,y); //写入坐标write_16byte((32+i)*16);//连续写入16字节数据y++; //y轴地址加1}write_command(0x34); //写入扩充指令命令write_command(0x36); //显示图象}}//初始化12864子程序void set12864(){write_command(0x30); //功能设定控制字write_command(0x0c); //显示开关控制字write_command(0x01); //清除屏幕控制字write_command(0x06); //进入设定点控制字}//设置绘图坐标void setxy(uchar x,uchar y){write_command(0x34); //写入扩充指令命令write_command(y); //写入y轴坐标write_command(x); //写入x轴坐标write_command(0x30); //写入基本指令命令}//写控制命令子程序void write_command(uchar command){bit flag="1"; //12864空闲标志位while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[comwr]=command; //空闲传送控制字}void write_16byte(uint data_add){bit flag="1"; //12864空闲标志位uchar num="16"; //16个循环,连续写入16个字节for(;num>0;num--){while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[datawr]=disp_data[data_add++]; //空闲传送数据}}//延时count秒子程序void delays(uchar count){unsigned char h,i,j,k;do{for(h=5;h>0;h--)for(i=4;i>0;i--)for(j=116;j>0;j--)for(k=214;k>0;k--);}while(--count);}程序代码如下:#include <reg52.h>#include"INTRINS.H"#define uint unsigned int#define uchar unsigned char#define x1 0x80#define x2 0x88#define y 0x80#define comm 0#define dat 1sbit cs = P0^0;sbit std = P0^1;sbit sclk = P0^2;//sbit rst = P0^3; //Reset Signal 低电平有效void wr_lcd (uchar dat_comm,uchar content);void delay (uint us);void lcd_char(uchar x0,uchar y0,uchar k,uchar *chn); void init_lcd (void);void lcd_string(uchar x0,uchar y0,uchar k,uchar *chn);/*------------------初始化-----------------*/void init_lcd (void){// rst=1;wr_lcd (comm,0x30); /*30---基本指令动作*/wr_lcd (comm,0x01); /*清屏,地址指针指向00H*/delay (100);wr_lcd (comm,0x06); /*光标的移动方向*/wr_lcd (comm,0x0c); /*开显示,关游标*/}/*--------------清DDRAM------------------*/void clrram (void){wr_lcd (comm,0x30);wr_lcd (comm,0x01);delay (180);}/*---------------------------------------*/void wr_lcd (uchar dat_comm,uchar content){uchar a,i,j;delay (500);a=content;cs=1;_nop_();sclk=0;_nop_();std=1;_nop_();for(i=0;i<5;i++){sclk=1;_nop_();_nop_();_nop_();sclk=0;}std=0;_nop_();sclk=1;_nop_();_nop_();_nop_();sclk=0;_nop_();if(dat_comm)std=1; //data elsestd=0; //command sclk=1;_nop_();_nop_();_nop_();sclk=0;std=0;_nop_();sclk=1;_nop_();_nop_();_nop_();sclk=0;for(j=0;j<2;j++){for(i=0;i<4;i++) {a=a<<1;std=CY;sclk=1;_nop_();_nop_();_nop_();sclk=0;}std=0;for(i=0;i<4;i++) {sclk=1;_nop_();_nop_();_nop_();sclk=0;}}}/*-----------------------------------*/void delay (uint us) //delay time{while(us--);}void delay1 (uint ms){uint i,j;for(i=0;i<ms;i++)for(j=0;j<15;j++)delay(1);}/*-------在任意位置显示一串汉字------X0为行,Y0为列,chn为所要显示的汉字串 ,k为汉字个数*/void lcd_char(uchar x0,uchar y0,uchar k,uchar *chn) {uchar adr,i;switch(x0){case 0: adr = 0x80 + y0;break; //在第1行y列显示case 1: adr = 0x90 + y0;break; //在第2行y列显示case 2: adr = 0x88 + y0;break; //在第3行y列显示case 3: adr = 0x98 + y0;break; //在第4行y列显示default: ;}wr_lcd (comm,0x30);wr_lcd (comm,adr);for(i=0;i<2*k;i++)wr_lcd (dat,chn[i]);}//在任意位置显示字符串,k为字符个数void lcd_string(uchar x0,uchar y0,uchar k,uchar *chn){uchar adr,i;switch(x0){case 0: adr = 0x80 + y0;break; //在第1行y列显示case 1: adr = 0x90 + y0;break; //在第2行y列显示case 2: adr = 0x88 + y0;break; //在第3行y列显示case 3: adr = 0x98 + y0;break; //在第4行y列显示default: ;}wr_lcd (comm,0x30);wr_lcd (comm,adr);for(i=0;i<k;i++)wr_lcd (dat,chn[i]);}/*------------------主程序--------------------*/ void main (){ uchar chn[4]={0x31,0x32,0x35,0x36};uchar b[]={"欢迎使用本程序"};init_lcd ();while (1){clrram();lcd_char(0,0,7,b);lcd_string(1,0,4,chn);delay1 (8000);}}/*********************************************************************//*文件名称:12864-01-8x8.asm SIDE: 128 X 64 DOTS */ /*模块名:12864-1 模块CONTROLLER: KS0108 */ /*创建人:zmlceo 日期:2008-12-01 *//*QQ:527717539 日期:2008-12-01 *//*功能描述:*//*其他说明:*//*版本:V1.0 *//*********************************************************************///显示/*****************//* *//* 12864lcd *//* *//* *//*****************/#include <reg52.h>#include <ctype.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <math.h>/* Define the register command code */#define Disp_On 0x3f#define Disp_Off 0x3e#define Col_Add 0x40#define Page_Add 0xb8#define Start_Line 0xc0#define Lcd_Bus P0 //MCU P1 LCM/*sbit Mcs="P2"^3; //Master chip enablesbit Scs="P2"^4; //Slave chip enablesbit Enable="P2"^0; //6800 mode Enable singlesbit Di="P2"^5; //Data or Instrument Selectsbit RW="P2"^6; //Write or Readsbit Lcd_Rst=P2^2; //Lcm resetsbit Test_Key=P2^1;*/sbit Mcs="P2"^3; //Master chip enablesbit Scs="P2"^4; //Slave chip enablesbit Enable="P2"^2; //6800 mode Enable singlesbit Di="P2"^0; //Data or Instrument Selectsbit RW="P2"^1; //Write or Readsbit Lcd_Rst=P2^5; //Lcm resetsbit Test_Key=P1^0;//;****************************************************************/*;RS REG P2.0 DEFINE LCM DATA/INSTRUCTION PIN ;R/W REG P2.1 DEFINE LCM READ/WRITE PIN;E REG P2.2 DEFINE LCM CHIP ENABLE PIN;CS1 REG P2.3 DEFINE LCM CHIP 1 SELECT PIN;CS2 REG P2.4 DEFINE LCM CHIP 2 SELECT PIN;RSTB REG P2.5 DEFINE LCM /RESET PIN*/char code SHU1[]={/*-- 文字: 1 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20, 0x00,0x00};char code SHU2[]={/*-- 文字: 2 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21, 0x30,0x00};char code SHU8[]={/*-- 文字: 8 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22, 0x1C,0x00};char code SHU6[]={/*-- 文字: 6 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11, 0x0E,0x00};char code SHU4[]={/*-- 文字: 4 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F, 0x24,0x00};char code L[]={/*-- 文字: L --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20, 0x30,0x00};char code C[]={/*-- 文字: C --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00};char code D[]={/*-- 文字: D --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10, 0x0F,0x00};/*****************//* *//* 12864LCD *//* *//* *//*****************//*------------------延时子程序-----------------------------*/void delay(unsigned int t){unsigned int i,j;for(i=0;i<t;i++)for(j=0;j<10;j++);}/*------------------写命令到LCD------------------------------*/void write_com(unsigned char cmdcode){Di=0;RW=0;Lcd_Bus=cmdcode;delay(0);Enable=1;delay(0);Enable=0;}/*-------------------写数据到LCD----------------------------*/ void write_data(unsigned char Dispdata){Di=1;RW=0;Lcd_Bus=Dispdata;delay(0);Enable=1;delay(0);Enable=0;}/*-------------------读LCD数据----------------------------*/ unsigned char read_data(){unsigned char tmpin;Di=1;RW=1;delay(0);Enable=1;delay(0);Enable=0;tmpin=Lcd_Bus;return tmpin;}/*------------------清除内存---------------*/void Clr_Scr(){unsigned char j,k;Mcs=1;Scs=1;write_com(Page_Add+0);write_com(Col_Add+0);for(k=0;k<8;k++){write_com(Page_Add+k);for(j=0;j<64;j++)write_data(0x00);}}/*---------------------指定位置显示字符8*16-----------------------*/void hz_disp816(unsigned char pag,unsigned char col, unsigned char cod e *hzk){unsigned char j="0",i=0;for(j=0;j<2;j++){write_com(Page_Add+pag+j);write_com(Col_Add+col);for(i=0;i<8;i++) write_data(hzk[8*j+i]);}}。
12864LCD显示图形文字程序代码--STC89C52
/********函数声明*************************************************************/ void WriteDataLCD(unsigned char WDLCD); void WriteCommandLCD(unsigned char WCLCD,BuysC); unsigned char ReadDataLCD(void); unsigned char ReadStatusLCD(void); void LCDInit(void); void LCDClear(void); void LCDFlash(void); void DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData); void DisplayListChar(unsigned char X, unsigned char Y, unsigned char code *DData); void DisplayImage (unsigned char code *DData); void Delay5Ms(void); void Delay400Ms(void);
sbit LCD_RS=P1^0;
sbit LCD_RW=P1^1;
sbit LCD_E=P1^2; sbit PSB =P1^6;
//PSB 脚为 12864-12 系列的串、并通讯功能切换,我们使用 8 位义***********************************************************/ #define LCD_Data P0 #define Busy 0x80 //用于检测 LCD 状态字中的 Busy 标识
12864显示汉字,图型,任意点,任意直线程序(绝对能用)
#include<stdio.h>#include<reg52.h>#include<math.h>#include<intrins.h>sbit RS=P0^0;sbit RW=P0^1;sbit E=P0^2;sbit PSB=P0^3;sbit RES=P0^4;#define LCD12864_DatePort P2unsigned char lcd_x,lcd_y;unsigned char h[]={"aaaaaaaaaaaaaaaa"};unsigned char code image[1024]={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,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,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xC0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0xFF,0xE0,0x00,0x00,0x00,0x1F,0xC1,0xC0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x07,0xFF,0xF8,0x00,0x00,0x00,0xFF,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x1F,0xFF,0xFC,0x00,0x00,0x01,0xFF,0xFE,0x1F,0x80,0x00,0x00,0x00,0x00, 0x00,0x00,0x3F,0xFF,0xFF,0x00,0x00,0x07,0xFF,0xFF,0x9E,0xC0,0x00,0x00,0x00,0x00, 0x00,0x00,0x7F,0xFF,0xFF,0x80,0x00,0x0F,0xFF,0xFF,0xEC,0x60,0x00,0x00,0x00,0x00, 0x00,0x00,0xFF,0xFF,0xFF,0xC0,0x00,0x0F,0xFF,0xFF,0xE0,0x40,0x00,0x00,0x00,0x00, 0x00,0x01,0xFF,0x3E,0x3F,0xC0,0x00,0x1F,0xE3,0xE7,0xF0,0x80,0x00,0x00,0x00,0x00, 0x00,0x01,0xFE,0x1E,0x1F,0xE0,0x00,0x3F,0xE3,0xC3,0xF9,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xFC,0x1C,0x1F,0xE0,0x00,0x3F,0xC1,0xC3,0xFC,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xFC,0x6D,0x9F,0xF0,0x00,0x7F,0xC1,0x81,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xFC,0x6D,0x8F,0xF0,0x00,0x7F,0xCD,0xB1,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xFC,0x6D,0x9F,0xF0,0x00,0x7F,0xCF,0x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,0x00,0x00,0xE3,0xF0,0x00,0x00,0x00,0x00, 0x03,0xF8,0x7F,0xFF,0xFC,0x1F,0xBF,0x87,0xC8,0x1F,0x83,0xF0,0x00,0x00,0x00,0x00, 0x03,0xF8,0x7F,0xFF,0xE0,0x1F,0xFF,0x87,0xFF,0xFC,0x01,0xF8,0x00,0x00,0x00,0x00, 0x03,0xF8,0x7F,0x00,0x00,0x1F,0xFF,0x04,0xE0,0x00,0x01,0xF8,0x00,0x00,0x00,0x00, 0x07,0xF8,0x7F,0x00,0x00,0x0F,0xFF,0x04,0x60,0x00,0x01,0xF8,0x00,0x00,0x00,0x00, 0x07,0xF8,0x7F,0x00,0x00,0x0F,0xFF,0x0C,0x60,0x00,0x01,0xFC,0x00,0x00,0x00,0x00, 0x07,0xF8,0x7F,0x00,0x00,0x0F,0xFF,0x0C,0x60,0x00,0x01,0xFC,0x00,0x00,0x00,0x00, 0x07,0xF8,0x7F,0x00,0x00,0x0F,0xFF,0x06,0x60,0x00,0x01,0xFC,0x00,0x00,0x00,0x00, 0x07,0xB8,0x3E,0x00,0x00,0x19,0xF3,0x87,0xE0,0x00,0x01,0xBC,0x00,0x00,0x00,0x00, 0x07,0x18,0x00,0x00,0x00,0x18,0xE3,0x80,0x00,0x00,0x01,0x18,0x00,0x00,0x00,0x00, 0x00,0x1C,0x00,0x00,0x00,0x10,0x01,0x80,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00, 0x00,0x0C,0x00,0x00,0x00,0x30,0x01,0xC0,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00, 0x00,0x06,0x00,0x00,0x00,0x60,0x00,0xE0,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x00,0x00,0x00,0x40,0x00,0x70,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x80,0x00,0x00,0xC0,0x00,0x78,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00, 0x00,0x0D,0xE0,0x00,0x03,0xB8,0x01,0x9C,0x00,0x00,0x3B,0x00,0x00,0x00,0x00,0x00, 0x00,0x18,0x78,0x00,0x0F,0x7C,0x03,0xCF,0x00,0x00,0xE7,0x80,0x00,0x00,0x00,0x00, 0x00,0x10,0x1C,0x00,0x3E,0xFC,0x03,0xF3,0xE0,0x03,0xDF,0x80,0x00,0x00,0x00,0x00, 0x00,0x1A,0x0B,0xC1,0xE3,0xF8,0x01,0xF8,0xFC,0x3F,0x3F,0x00,0x00,0x00,0x00,0x00, 0x00,0x0F,0xF1,0x80,0xEF,0xE0,0x00,0x7F,0xF0,0x1F,0xFC,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, 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_ms(unsigned char z) //延时{unsigned i,j;for(i=0;i<z;i++)for(j=0;j<110;j++);}void LCD12864_WriteCmd(unsigned int cmd) //写命令{RS=0;RW=0;E=0;LCD12864_DatePort=cmd;delay_ms(5);E=1;delay_ms(5);E=0;}void LCD12864_WriteDate(unsigned char dat) //写数据{RS=1;RW=0;E=0;LCD12864_DatePort=dat;delay_ms(5);E=1;delay_ms(5);E=0;}void LCD12864_Init(){PSB=1; //1并行,0串行LCD12864_WriteCmd(0x30); //基本指令操作//delay_ms(5);LCD12864_WriteCmd(0x0c); //显示开,关光标//delay_ms(5);LCD12864_WriteCmd(0x01); //清除led的显示内容//delay_ms(5);LCD12864_WriteCmd(0x06);}/*====================================================函数功能:清除GCROM的内容,如果不清除会出现花屏现象清除方法:向GCROM中写入0x00来清除内========================================================*/ void LCD12864_ClearGDRAM(){unsigned char i,j,k;lcd_x=0x80;lcd_y=0x80;LCD12864_WriteCmd(0x34);for(i=0;i<2;i++){for(j=0;j<32;j++){LCD12864_WriteCmd(lcd_y+j);LCD12864_WriteCmd(lcd_x);for(k=0;k<16;k++){LCD12864_WriteDate(0x00);}}lcd_x=0x88;}LCD12864_WriteCmd(0x36);LCD12864_WriteCmd(0x30);}/*================================================================ 函数功能:向12864中写入一幅图片函数参数:lcd_x为水平显示位置,lcd_y为垂直显示位置,函数将12864屏分成上下两屏写入,上半屏LCD_x=0x80,下半屏lcd_x=0x88=================================================================*/ void LCD12864_WriteImage(unsigned char *p){unsigned char i,j,k;lcd_x=0x80;lcd_y=0x80;LCD12864_WriteCmd(0x34);for(i=0;i<2;i++) //分为上下两屏{for(j=0;j<32;j++){LCD12864_WriteCmd(lcd_y+j);LCD12864_WriteCmd(lcd_x);for(k=0;k<16;k++) //写入显示数据{LCD12864_WriteDate(*p++);}}lcd_x=0x88;}LCD12864_WriteCmd(0x36);LCD12864_WriteCmd(0x30);}bit LCD12864_CheckBusy() //读忙碌状态{bit i;RS=0;RW=1;E=1;LCD12864_DatePort=0xff;delay_ms(1);i=(bit)(LCD12864_DatePort&0x80);E=0;return(i);}unsigned char LCD12864_ReadByte( void ){unsigned char ReturnValue ;LCD12864_CheckBusy() ;LCD12864_DatePort = 0xff ;RS=1;RW=1;E=0;E=1;ReturnValue =LCD12864_DatePort;E=0;return ReturnValue ;}void LCD12864_DrawPoint( unsigned char X, unsigned char Y, unsigned char Color ) {unsigned char Row , Tier , Tier_bit ;unsigned char ReadOldH, ReadOldL ;LCD12864_WriteCmd( 0x34 ) ;LCD12864_WriteCmd( 0x36 ) ;Tier = X >> 4 ;Tier_bit = X & 0x0f ;if( Y < 32 ){Row = Y ;}else{Row = Y - 32 ;Tier += 8 ;}LCD12864_WriteCmd( Row + 0x80 ) ;LCD12864_WriteCmd( Tier + 0x80 ) ;LCD12864_ReadByte();ReadOldH = LCD12864_ReadByte() ;ReadOldL = LCD12864_ReadByte() ;LCD12864_WriteCmd( Row + 0x80 ) ;LCD12864_WriteCmd( Tier + 0x80 ) ;if( Tier_bit < 8 ){switch( Color){case 0 : ReadOldH &=( ~( 0x01 << ( 7 - Tier_bit ))) ; break ;case 1 : ReadOldH |= ( 0x01 << ( 7 - Tier_bit )) ; break ;case 2 : ReadOldH ^= ( 0x01 << ( 7 - Tier_bit )) ; break ;default : break ;}LCD12864_WriteDate( ReadOldH ) ;LCD12864_WriteDate( ReadOldL ) ;}else{switch(Color){case 0 : ReadOldL &= (~( 0x01 << ( 15 - Tier_bit ))) ; break ;case 1 : ReadOldL |= ( 0x01 << ( 15 - Tier_bit )) ; break ;case 2 : ReadOldL ^= ( 0x01 << ( 15 - Tier_bit )) ; break ;default : break ;}LCD12864_WriteDate( ReadOldH ) ;LCD12864_WriteDate( ReadOldL ) ;}LCD12864_WriteCmd( 0x30 ) ;}void LCD12864_DrawLine_X( unsigned char X0, unsigned char X1, unsigned char Y, unsigned char Color ){ unsigned char Temp ;if( X0 > X1 ){Temp = X1 ;X1 = X0 ;X0 = Temp ;}for( ; X0 <= X1 ; X0++ )LCD12864_DrawPoint( X0, Y, Color ) ;}void LCD12864_DrawLine_Y( unsigned char X, unsigned char Y0, unsigned char Y1, unsigned char Color ){unsigned char Temp ;if( Y0 > Y1 ){Temp = Y1 ;Y1 = Y0 ;Y0 = Temp ;}for(; Y0 <= Y1 ; Y0++)LCD12864_DrawPoint( X, Y0, Color) ;}void LCD12864_DrawLine( unsigned char StartX, unsigned char StartY, unsigned char EndX, unsigned char EndY, unsigned char Color ){int t, distance; /*根据屏幕大小改变变量类型(如改为int型)*/int x = 0 , y = 0 , delta_x, delta_y ;char incx, incy ;delta_x = EndX - StartX ;delta_y = EndY - StartY ;if( delta_x > 0 ){incx = 1;}else if( delta_x == 0 ){LCD12864_DrawLine_Y( StartX, StartY, EndY, Color ) ;return ;}else{incx = -1 ;}if( delta_y > 0 ){incy = 1 ;}else if(delta_y == 0 ){LCD12864_DrawLine_X( StartX, EndX, StartY, Color ) ;return ;}else{incy = -1 ;}delta_x = abs( delta_x );//求绝对值delta_y = abs( delta_y );if( delta_x > delta_y ){distance = delta_x ;}else{distance = delta_y ;}LCD12864_DrawPoint( StartX, StartY, Color ) ;/* Draw Line*/for( t = 0 ; t <= distance+1 ; t++ ){LCD12864_DrawPoint( StartX, StartY, Color ) ;x += delta_x ;y += delta_y ;if( x > distance ){x -= distance ;StartX += incx ;}if( y > distance ){y -= distance ;StartY += incy ;}}}void LCD12864_DrawCross(){LCD12864_DrawLine_X( 0, 127 , 0, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 7, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 15, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 23, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 31, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 39, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 47, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 55, 1 ) ;LCD12864_DrawLine_X( 0, 127 , 63, 1 ) ;LCD12864_DrawLine_Y( 0, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 15, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 31, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 47, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 63, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 79, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 95, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 111, 0 , 63, 1 ) ;LCD12864_DrawLine_Y( 127, 0 , 63, 1 ) ;}void LCD12864_Draw_ObliqueLine(){LCD12864_DrawLine( 0, 0, 127, 63, 1 ) ;LCD12864_DrawLine( 0, 63, 127, 0 , 1 ) ;LCD12864_DrawLine( 12, 0, 127, 63, 1 ) ;LCD12864_DrawLine( 52, 63, 127, 0 , 1 ) ;LCD12864_DrawLine( 32, 63, 98, 0, 1 ) ;LCD12864_DrawLine( 67, 0, 127, 63 , 1 ) ;}void LCD12864_DisplayOneChar(unsigned char X, unsigned char Y, unsigned char Data) {switch(Y){case 0:Y=0X80;break; //根据行数来选择相应地址case 1:Y=0X90;break;case 2:Y=0X88;break;case 3:Y=0X98;break;}LCD12864_WriteCmd( Y+X ); //这里不检测忙信号,发送地址码LCD12864_WriteDate(Data);}void LCD12864_DisplayListChar(unsigned char X, unsigned char Y, unsigned char *Data) {switch(Y){case 0:Y=0X80;break; //根据行数来选择相应地址case 1:Y=0X90;break;case 2:Y=0X88;break;case 3:Y=0X98;break;}LCD12864_WriteCmd( Y+X ); //这里不检测忙信号,发送地址码X = X*2;Y = 0;while( Data[Y] != 0 ) //若到达字串尾则退出{if (X <= 0x0F) //X坐标应小于0xF{LCD12864_WriteDate(Data[Y]);X++;Y++;}else break;}}void main(){LCD12864_Init();// write_com(0x1c);LCD12864_ClearGDRAM();//LCD12864_WriteImage(image);//LCD12864_Draw_ObliqueLine();LCD12864_DrawCross();//LCD12864_DisplayListChar(0,0,h);while(1);}。
12864液晶显示程序
12864液晶显示程序#include <reg51.h>#include <intrins.h>sbit RS = P2^5;sbit RW = P2^6;sbit E = P2^7;sbit RES = P3^5;#define Lcd_Bus P0 //MCU P1<------> LCM#define FIRST_ADDR 0 //定义字符/汉字显示起始位置unsigned char code zk[]={0x08,0x20,0x1c,0x10,0x1c,0x1c,0xff,0x9e,0x7f,0x1e,0x1c,0x1f,0x3e,0x1f,0x3e,0x1f, 0x77,0x1f,0x41,0x3f,0x00,0x7e,0x00,0xfe,0x83,0xfc,0x7f,0xf8,0x3f,0xf0,0x0f,0xc0, };unsigned char code BMP1[]={/*-- 调入了一幅图像:D:\3033B\3033.bmp --*//*-- 宽度x高度=128x64 --*//*--总共52行数据,每行16个数据--*/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, 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0C,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x08,0x00,0x00,0x00,0x00,0x00,0x07,0xF1,0x00,0x03,0x01,0x00,0xF0,0x00,0x00,0x00, 0x18,0x00,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x03,0x81,0x08,0x98,0x00,0x00,0x00, 0x10,0x1F,0x07,0x06,0x00,0x00,0x08,0x01,0x00,0x04,0x81,0x11,0x88,0x00,0x00,0x00, 0x10,0x21,0x0D,0x83,0xE3,0xC0,0x0F,0x02,0x00,0x04,0xC1,0x31,0x30,0x00,0x00,0x00, 0x10,0x21,0x18,0x83,0x06,0x40,0x09,0x82,0x00,0x0F,0xC1,0x21,0xE0,0x00,0x00,0x00, 0x10,0x2E,0x11,0x86,0x06,0x40,0x00,0x86,0x00,0x08,0x43,0xC3,0xE0,0x00,0x00,0x00, 0x30,0x30,0x11,0x86,0x04,0x40,0x41,0x84,0x10,0x18,0x63,0x82,0x18,0x00,0x00,0x00, 0x20,0x1E,0x1F,0x84,0x04,0x60,0x7E,0x04,0x08,0x10,0x23,0x04,0x0E,0x00,0x00,0x00, 0x3F,0x83,0x00,0xE0,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x02,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,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x38,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x6C,0x3C,0x00,0x20,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x42,0x22,0x03,0xFD,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x40,0x62,0x00,0x22,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x46,0x42,0x00,0x22,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x44,0x42,0x00,0x23,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x7C,0x26,0x00,0x2D,0xB0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x0C,0x3C,0x00,0x38,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x06,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x02,0x30,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0xE0,0x00,0x00,0x00,0x00,0x00,0x03,0x18,0x08,0x0C,0x30,0xF1,0x08,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x08,0x08,0x0C,0x31,0x91,0x08,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x08,0x08,0x1A,0x71,0x01,0x08,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x08,0x13,0xD1,0x01,0x08,0x00, 0x00,0x00,0x08,0x11,0x0A,0x00,0x20,0x20,0x04,0x04,0x18,0x11,0x91,0x01,0x08,0x00, 0x00,0x00,0x04,0x11,0x12,0x31,0x22,0x20,0x04,0x04,0x10,0x11,0x13,0x01,0x08,0x00, 0x00,0x00,0x02,0x1B,0x92,0x31,0x26,0x20,0x04,0x04,0x10,0x10,0x12,0x01,0x08,0x00, 0x3F,0xFF,0xFF,0x0A,0x91,0x73,0x25,0x60,0x04,0x44,0x10,0x10,0x12,0x01,0x08,0x00, 0x00,0x00,0x02,0x0A,0xB1,0x4A,0x35,0x40,0x04,0x34,0x30,0x10,0x13,0x01,0x08,0x00, 0x00,0x00,0x04,0x0E,0x61,0xCA,0x19,0x40,0x04,0x1C,0x20,0x10,0x11,0x19,0x98,0x00, 0x00,0x00,0x08,0x04,0x60,0xCC,0x19,0xCC,0x06,0x0E,0x20,0x10,0x11,0xF0,0xFC,0xC0, 0x00,0x00,0x00,0x04,0x60,0x8C,0x18,0x8C,0x03,0xF3,0xBF,0x80,0x00,0x00,0x00,0xC0, 0x00,0x00,0x00,0x00,0x40,0x80,0x10,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,0x0F,0x83,0x80,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x06,0xC3,0xFC,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x08,0x22,0x44,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x08,0x22,0x42,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x08,0x26,0x42,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x08,0x24,0x42,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x48,0x64,0x42,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0xC4,0x44,0x42,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x03,0x84,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,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,};unsigned char code BMP[]={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,0x04,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x20,0x00,0x00,0x00,0x00, 0x1F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x42,0x00,0x00,0x00,0x00, 0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x40,0x84,0x00,0x00,0x00,0x00, 0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0xE0,0x04,0x00,0x08,0x80,0x60,0x00,0x00, 0x00,0x1F,0xFF,0xC0,0x00,0x00,0x00,0x01,0x10,0x02,0x1F,0xC1,0x01,0xD0,0x00,0x38, 0x00,0x00,0x00,0x01,0xFC,0x00,0x00,0x00,0x10,0x00,0x70,0x72,0x01,0x0C,0x00,0x68, 0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x06,0x13,0x08,0x40,0x08,0x03,0x06,0x00,0xCC, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x09,0x84,0x80,0x0C,0x1E,0x03,0x89,0x86, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0xC1,0x80,0x04,0x68,0x00,0xFF,0x02, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x41,0x00,0x00,0xC0,0x00,0x60,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x61,0x00,0x00,0x80,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x31,0x00,0x00,0x80,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x0C,0x00,0x00,0x80,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x01,0x80,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x06,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x00,0xC0,0x00,0x03,0x00,0x02,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0xE8,0x00,0x00,0x01,0x80,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x1A,0x08,0x00,0x00,0x03,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x08,0x00,0x00,0x02,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x08,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x10,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x3C,0x18,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x02,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x04,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x04,0x00,0x02,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0xF4,0x00,0x02,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x79,0xF8,0x10,0x20,0x00, 0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x09,0x08,0x10,0x20,0x00, 0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x09,0x08,0x10,0x20,0x00, 0x06,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x79,0xF8,0x10,0x20,0x00, 0x04,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0xFD,0xFE,0x00, 0x04,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x43,0xFC,0x10,0x20,0x00, 0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x03,0xFF,0xF0,0x42,0x44,0x10,0x60,0x00, 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x7A,0x44,0x38,0x70,0x00, 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x0B,0xFC,0x74,0xB0,0x00, 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x08,0x40,0x54,0xA8,0x00, 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x08,0x48,0x91,0x28,0x00, 0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x08,0x44,0x12,0x26,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x7E,0x14,0x24,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0xC4,0x10,0x20,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x10,0x20,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,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, };/*------------------检查忙位-----------------------------*/void chk_busy(){ RS=0;RW=1;E=1;Lcd_Bus=0xff;while((Lcd_Bus&0x80)==0x80);E=0;}/*------------------延时子程序-----------------------------*/void delay(unsigned int t){ unsigned int i,j;for(i=0;i<t;i++)for(j=0;j<10;j++);}/*------------------写命令到LCD------------------------------*/void write_com(unsigned char cmdcode){chk_busy();RS=0;RW=0;E=1;Lcd_Bus=cmdcode;delay(5);////////////////////在数据写入的时候加入适当的延时E=0;delay(5);}/*-------------------写数据到LCD----------------------------*/void write_data(unsigned char Dispdata){chk_busy();RS=1;RW=0;E=1;Lcd_Bus=Dispdata;delay(5);///////////////////在数据写入的时候加入适当的延时E=0;delay(5);}/*------------------初始化LCD屏--------------------------*/void lcdreset(){ delay(2000);write_com(0x30);delay(10); //选择基本指令集write_com(0x30); //选择8bit数据流delay(5);write_com(0x0c); //开显示(无游标、不反白)delay(10);write_com(0x01); //清除显示,并且设定地址指针为00Hdelay(500);write_com(0x06); //指定在资料的读取及写入时,设定游标的移动方向及指定显示的移位delay(0);}/*------------------自定义一个字符代码(一个星星和月亮)--------------------------*/void CGRAM(){ int i;write_com(0x30);write_com(0x40);for(i=0;i<16;i++){write_data(zk[i*2]);write_data(zk[i*2+1]);}}/*------------------显示字符串--------------------------*/void hzkdis(unsigned char code *s){ while(*s>0){ write_data(*s);s++;delay(50);}}/*------------------首屏显示--------------------------*/void ceshi(){write_com(0x01);//清除显示,并且设定地址指针为00Hdelay(5);write_com(0x80);//第一行(如果是地址是:80H,即LCD的第一行的第一个位置显示)hzkdis("----强林单片机");write_com(0x90);//第二行(如果是地址是:90H,即LCD的第二行的第一个位置显示)hzkdis("--技术项目交易网");write_com(0x88);//第三行(如果是地址是:88H,即LCD的第二行的第一个位置显示)hzkdis("LCD12864点阵液晶");write_com(0x9A);//第四行(如果是地址是:98H,即LCD的第二行的第一个位置显示)hzkdis("测试程序");}/*------------------显示图片------------------------2005.11.14.21:20修改---benladn911---*/void Disp_Img(unsigned char code *img){ unsigned int j=0;unsigned char x,y,i;for(i=0;i<9;i+=8)for(y=0;y<32;y++)/*原来为 y<26 ,上下两个半屏不能正常对接显示,导致显示的图片中间有空隙*/ for(x=0;x<8;x++){ write_com(0x36);//功能设置---8BIT控制界面,扩充指令集write_com(y+0x80); //行地址write_com(x+0x80+i); //列地址write_com(0x30);write_data(img[j++]);write_data(img[j++]);}}/*------------------清整个GDRAM空间----------------------------*/void clrgdram(){ unsigned char x,y;for(y=0;y<64;y++)for(x=0;x<16;x++){ write_com(0x34);write_com(y+0x80); //行地址write_com(x+0x80); //列地址write_com(0x30);write_data(0x00);write_data(0x00);}}/*------------------整屏写入数据:全亮,或者竖条-----------------------------*/void lcdfill(unsigned char disdata){ unsigned char x,y;for(y=0;y<32;y++)for(x=0;x<16;x++){ write_com(0x36);write_com(y+0x80); //行地址write_com(x+0x80); //列地址write_com(0x30);write_data(disdata);write_data(disdata);}write_com(0x34);write_com(0x36);}/*------------------显示横-----------------------------*/void Disp_H_Line(){ unsigned char x,y;unsigned char k=0x00;for(y=0;y<32;y++){ k=~k;for(x=0;x<16;x++){ write_com(0x36);write_com(y+0x80); //行地址write_com(x+0x80); //列地址write_com(0x30);write_data(k);write_data(k);};}write_com(0x34);write_com(0x36);}/*------------------显示边框-------------------------------*/void Frame(){unsigned char x,y;lcdfill(0x00);for(x=0;x<9;x+=8)for(y=0;y<32;y++){ write_com(0x36);write_com(y+0x80); //行地址write_com(x+0x80); //列地址write_com(0x30);write_data(0x80);write_data(0x00);write_com(0x36);write_com(y+0x80); //行地址write_com(x+0x87); //列地址write_com(0x30);write_data(0x00);write_data(0x01);}for(y=0;y<2;y++)for(x=0;x<8;x++){write_com(0x36);write_com(y*31+0x80); //行地址write_com(x+0x80+8*y); //列地址write_com(0x30);write_data(0xff);write_data(0xff);}write_com(0x34);write_com(0x36);}/*------------------在第7列的位置加入两条竖线--------------------------*/ void shuxian(){ unsigned char x,y;for(x=0;x<9;x+=8)for(y=0;y<32;y++){ write_com(0x36);write_com(y+0x80); //行地址write_com(x+0x86); //列地址write_com(0x30);write_data(0x00);write_data(0x14);};}/*------------------清屏命令--------------------------*/void clrscreen(){write_com(0x01);delay(10);}/*------------------唐诗《静夜思》--------------------------*/void gushi_display(){ write_com(0x30);clrscreen();write_com(0x80+FIRST_ADDR);hzkdis("床前明月光,");write_com(0x90+FIRST_ADDR);hzkdis("疑是地上霜。
12864液晶图像显示图文教程——最全版
uchar i,j; write_cmd(0x34);//扩充指令集动作 write_cmd(0x34);//关绘图显示功能 for(i=0;i<32;i++)//上半屏 { write_cmd(0x80+i);//垂直地址 write_cmd(0x80); //水平地址,水平地址自动加 1 for(j=0;j<16;j++) { write_data(0x00); } } for(i=0;i<32;i++)//下半屏 { write_cmd(0x88+i);//垂直地址 write_cmd(0x88);//水平地址,水平地址自动加 1 for(j=0;j<16;j++) { write_data(0x00); } } write_cmd(0x36);//开绘图显示 write_cmd(0x30);//回到基本指令集 } //函数名称:display_image(uchar *p) //函数功能:显示图片 void display_image(uchar *p) { uchar i,j; write_cmd(0x34);//扩充指令集动作 write_cmd(0x34);//关绘图显示功能 /*上半屏显示设置*/ for(i=0;i<32;i++)//上半屏 { write_cmd(0x80+i);//垂直地址 write_cmd(0x80); //水平地址,水平地址自动加 1
LCD 12864液晶显示汉字程序
/*--文字: --*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
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,
/*--文字: --*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x04,0x04,0x04,0x04,0x44,0x84,0x7E,0x05,0x04,0x04,0x04,0x04,0x04,0x04,0x00,
/*--文字: --*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x40,0x20,0x10,0x0E,0x10,0x20,0x3F,0x44,0x44,0x44,0x44,0x44,0x40,0x40,0x00,
/*--文字:地--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
12864汉字和图片的显示
12864汉字和图片的显示课程设计报告书设计题目:12864汉字和图片的显示课程名称:单片机快速入门系部:电子信息系专业:应用电子技术班级:电子0901姓名:组长:学号:成绩:2011年6月16日目录任务安排 (3)一、项目介绍 (3)1.1 设计内容 (3)1.2 设计要求 (3)1.3 系统主要功能 (4)二、硬件设计 (4)2.1 原理电路图 (4)2.2主要元件功能说明 (5)三、系统软件设计 (10)3.1 分析论证 (10)3.2 程序流程图 (12)3.3 源程序清单 (13)四、个人心得 (19)五、结束语 (20)六、参考文献 (21)七、12864汉字和图片的显示原理图 (21)任务安排一、项目介绍1.1 设计内容利用单片机和12864液晶显示屏通过按键功能实现汉字和图片的显示1.2 设计要求(1)在12864上第一次显示汉字“安徽财贸职业学院大学城翡翠路900/doc/dd174fd133d4b14e852468a7.ht ml ”(2)在12864上第二次显示汉字“单片机实训周6月11日星期六”(3)第三次显示图片:服装,帽子,鞋,皮包等(4)第四次显示汉字:“这就是我们小组的设计方案谢谢欣赏”1.3系统主要功能:12864LCD指令系统及时序该类液晶显示模块(表1-1)控制信号控制代码指令名称R/W RS DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 显示开关0 0 0 0 1 1 1 1 1 1/0 起始行设置0 0 1 1 X X X X X X 页设置0 0 1 0 1 1 1 X X X 列地址设置0 0 0 1 X X X X X X 读状态 1 0 BUSY 0 ON/OFF RST 0 0 0 0 写数据0 1 写数据读数据 1 1 读数据二、硬件设计2.1 原理电路图12864显示屏(图2-1a)独立按键原理图(图2-1b)2.2主要元件功能说明1)12864显示屏内部功能器件及相关功能如下指令寄存器(IR): IR是用于寄存指令码,与数据寄存器数据相对应。
12864液晶显示汉字程序
/*=============================程序说明=============================== 项目名称: 显示汉字作者:创建日期:修改说明:程序说明:(1)CPU 型号:(2)时钟频率:(3)实现功能:(4)程序概述:===================================================================*/ //==========================头文件加载=============================== #include <mega16.h>#include <delay.h>#include "music.h"//===========================端口声明================================ #define LcdRS PORTB.0 //#define LcdRSDDR DDRB.0 //#define LcdRW PORTB.1 //#define LcdRWDDR DDRB.1 //#define LcdEN PORTB.4 //#define LcdENDDR DDRB.4 //#define LcdRST PORTB.6 //#define LcdRSTDDR DDRB.6 //#define LcdIoIn PORTA //#define LcdIoOut PINA //#define LcdIoDDR DDRA //#define LcdIn() LcdIoDDR = 0xff //调整输入输出#define LcdOut() LcdIoDDR = 0x00//=========================全局常量声明============================== //=========================全局变量声明==============================//===========================函数声明================================ void Lcd_init(void);void Lcd_CheckBusy(void);void Lcd_WriteCommand(uint8 com);void Lcd_WriteDat(uint8 Dat);void Lcd_writeStringRom(uint8 Add, uint8 flash String[]);//============================主函数================================= void main()//主函数{//---------------------------系统初始化--------------------------Lcd_init();music_init();Lcd_writeStringRom(0x80, "梁成颂");while(1){}}//===========================功能子函数================================ void Lcd_init(void){LcdRS = 1;LcdRSDDR = 1;LcdRW = 1;LcdRWDDR = 1;LcdEN = 1;LcdENDDR = 1;LcdRST = 1; //LcdRSTDDR = 1;LcdIoIn = 1; //LcdIoDDR = 1;LcdIoIn = 0xff; //LcdIn(); //LcdRST = 0;delay_ms(20);LcdRST = 1;delay_ms(50);Lcd_WriteCommand(0x38); //系统设置delay_ms(1);Lcd_WriteCommand(0x38); //系统设置Lcd_WriteCommand(0x08); //开显示Lcd_WriteCommand(0x01); //清屏Lcd_WriteCommand(0x06); //光标设置Lcd_WriteCommand(0x0c); //开显示Lcd_WriteCommand(0x01); //清屏}void Lcd_CheckBusy(void) //怕忙检测{LcdOut();LcdRS = 0;LcdRW = 1;LcdEN = 1;while((LcdIoOut & 0x80) == 0x80);LcdEN = 0;}void Lcd_WriteCommand(uint8 com) //写指令{Lcd_CheckBusy();LcdIn();LcdRS = 0;LcdRW = 0;LcdEN = 1;LcdIoIn = com;LcdEN = 0;}void Lcd_WriteDat(uint8 Dat) //写指令{Lcd_CheckBusy();LcdIn();LcdRS = 1;LcdRW = 0;LcdEN = 1;LcdIoIn = Dat;LcdEN = 0;}void Lcd_writeStringRom(uint8 Add, uint8 flash String[]) {uint16 i = 0;Lcd_WriteCommand(Add);while(String[i] != '\0'){Lcd_WriteDat(String[i]);i++;}}。
12864液晶屏幕使用说明及程序
12864使用说明一、串/并接口1.1 串口接口管脚信号*注释1:如在实际应用中仅使用并口通讯模式,可将PSB 接固定高电平。
*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。
*注释3:如背光和模块共用一个电源,可以将模块上的JA、JK 用焊锡短接。
1.2 并行接口管脚信号*注释1:如在实际应用中仅使用并口通讯模式,可将PSB 接固定高电平。
*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。
*注释3:如背光和模块共用一个电源,可以将模块上的JA、JK 用焊锡短接。
二、模块主要硬件构成说明控制器接口信号说明:2.1、RS,R/W的配合选择决定控制界面的4种模式:2.2、E信号●忙标志BFBF 标志提供内部工作情况.BF=1 表示模块在进行内部操作,此时模块不接受外部指令和数据.BF=0 时, 模块为准备状态,随时可接受外部指令和数据.利用STATUS RD 指令,可以将BF 读到DB7 总线,从而检验模块之工作状态.●字型产生ROM(CGROM)字型产生ROM(CGROM)提供8192 个此触发器是用于模块屏幕显示开和关的控制。
DFF=1 为开显示(DISPLAY ON),DDRAM 的内容就显示在屏幕上,DFF=0 为关显示(DISPLAY OFF)。
DFF 的状态是指令DISPLAY ON/OFF 和RST 信号控制的。
●显示数据RAM(DDRAM)模块内部显示数据 RAM 提供 64×2 个位元组的空间,最多可控制 4 行 16 字(64 个字)的中文字型显示,当写入显示数据 RAM 时,可分别显示 CGROM 与CGRAM 的字型;此模块可显示三种字型,分别是半角英、数字型(16*8)、CGRAM 字型及 CGROM 的中文字型。
三种字型的选择,由在 DDRAM 中写入的编码选择,在0000H—0006H 的编码中(其代码分别是 0000、0002、0004、0006 共 4 个)将选择 CGRAM 的自定义字型,02H—7FH 的编码中将选择半角英数字的字型,至于A1 以上的编码将自动的结合下一个位元组,组成两个位元组的编码形成中文字型的编码BIG5(A140—D75F),GB(A1A0-F7FFH)。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#include <REG52.H>sbit LCD12864_RS = P2^0; //RS控制引脚sbit LCD12864_RW = P2^1; //RW控制引脚sbit LCD12864_EN = P2^2; //EN控制引脚sbit LCD12864_PSB = P2^3; //模式选择引脚,ST7920控制器,1为8位并行接口,0为串行接口#define LCDPORT P0//数据引脚void LCD12864_Init(void); //LCD12864初始化函数void LCD12864_WriteInfomation(unsigned char ucData,bit bComOrData); //向LCD12864写入数据,bComOrData为1时写入的是数据,0时写入的是命令void LCD12864_CheckBusy(void);//忙检测函数void LCD12864_DisplayImage(unsigned char code *ucImage);void Delay(unsigned int uiCount);unsigned char code ucPic1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x30,0x01,0xE0,0x00,0x00,0x2A,0x00,0x00,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x7B,0x63,0xE0,0x00,0x00,0x22,0x00,0x01,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFB,0x63,0x07,0x34,0x00,0x14,0x00,0x01,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0xDB,0x63,0x01,0xBC,0x00,0x08,0x00,0x00,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x1B,0x63,0x07,0xB0,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x1B,0x63,0xED,0xB0,0xDB,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x19,0xE1,0xE7,0xB0,0xDB,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x19,0xE1,0xE7,0xB0,0xDB,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x0A,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0xFF,0xF8,0xE0,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xC0,0x15,0x00,0x1F,0xFF,0xFF,0xC0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x20,0x11,0x00,0xFB,0xFF,0xE1,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x20,0x0A,0x03,0x9F,0x00,0x9E,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x40,0x04,0x0E,0x70,0x00,0x81,0xC7,0x80,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x1D,0x80,0x00,0xE0,0x61,0xE0,0x02,0xA0,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x77,0x9F,0xFC,0xF0,0x18,0xF8,0x02,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xDF,0x00,0x00,0xF3,0x0C,0x3C,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x9E,0x00,0x00,0xF8,0x06,0x1E,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0E,0x30,0x01,0xFC,0x7F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0E,0x30,0x01,0xFC,0x7F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xFF,0xFF,0xFF,0xFF,0xFF,0x83,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFD,0xFF,0xFF,0xFF,0xFF,0xFC,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x81,0xFF,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xFE,0xF0,0x00,0x00,0x01,0x00,0x00,0xC0,0x1C,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xC0,0x07,0x80,0x00,0x03,0xE0,0x07,0x00,0x1C,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x80,0x03,0x40,0x00,0x03,0xE0,0x0C,0x00,0x0E,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0x00,0x00,0xC0,0x00,0x00,0x20,0x18,0x00,0x07,0x00,0x00,0x00,0x00,0x00, 0x00,0x09,0x01,0x80,0x60,0x00,0x00,0x20,0x73,0x9F,0x03,0x80,0x00,0x00,0x00,0x00, 0x00,0x1E,0x0F,0xF2,0x20,0x00,0x00,0x20,0x67,0xFF,0xC1,0xC0,0x00,0x00,0x00,0x00, 0x00,0x1E,0x1F,0xF9,0x30,0x00,0x00,0x20,0xEF,0xFF,0xE0,0xE0,0x00,0x00,0x00,0x00, 0x00,0x38,0x3F,0xFC,0x90,0x00,0x00,0x20,0xCB,0xFF,0xF9,0xF0,0x00,0x00,0x00,0x00, 0x00,0x7F,0x7F,0xFE,0x10,0x00,0x00,0x20,0xDB,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00, 0x00,0x6E,0xF9,0xBF,0x10,0x00,0x00,0x20,0xF7,0xED,0xFF,0xF0,0x00,0x00,0x00,0x00, 0x00,0x7C,0xFC,0x3F,0x10,0x00,0x00,0x20,0x67,0xE1,0xFD,0xE0,0x00,0x00,0x00,0x00, 0x00,0x7C,0xFC,0x3F,0x10,0x00,0x00,0x20,0x67,0xE1,0xFD,0xE0,0x00,0x00,0x00,0x00, 0x00,0x38,0xFC,0x3F,0x18,0x00,0x00,0x20,0x87,0xE0,0xFD,0xC0,0x00,0x00,0x00,0x00, 0x00,0x38,0xF1,0x8F,0x18,0x00,0x1F,0xE7,0x87,0x9C,0x7D,0xC0,0x00,0x00,0x00,0x00, 0x00,0x1C,0xFE,0x1F,0x81,0xFF,0xFF,0xC0,0x0F,0xE0,0xFF,0x80,0x00,0x00,0x00,0x00, 0x00,0x0C,0xFC,0x3F,0x80,0x00,0x00,0x00,0x0F,0xE1,0xF8,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xF9,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEC,0xFE,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0xF9,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00, 0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,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,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,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,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};unsigned char code ucPic[]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xF0,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x18,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xFF,0xDC,0x00,0x01, 0x80,0x00,0x1F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xFF,0xBC,0x00,0x01, 0x80,0x00,0x30,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x01,0x7F,0xFF,0xB8,0x00,0x01, 0x80,0x00,0x30,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x01,0x7F,0xFF,0x78,0x00,0x01, 0x80,0x00,0x19,0xFF,0xFE,0xC0,0x00,0x00,0x00,0x00,0x02,0xFF,0xFF,0x70,0x00,0x01, 0x80,0x00,0x18,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0xFF,0xFE,0xF0,0x00,0x01, 0x80,0x00,0x0C,0x01,0xFF,0x60,0x00,0x00,0x00,0x00,0x05,0xFF,0xFE,0xE0,0x00,0x01, 0x80,0x00,0x0C,0x7F,0xD0,0x20,0x00,0x00,0x00,0x00,0x05,0xFF,0xFD,0xE0,0x00,0x01, 0x80,0x00,0x06,0x00,0x0F,0xB0,0x00,0x00,0x00,0x00,0x0B,0xFF,0xFD,0xC0,0x00,0x01, 0x80,0x00,0x06,0x03,0xFC,0x10,0x00,0x00,0x00,0x00,0x0B,0xFF,0xFB,0xC0,0x00,0x01, 0x80,0x00,0x03,0x1F,0x00,0x18,0x00,0x00,0x00,0x00,0x17,0xFF,0xFB,0x80,0x00,0x01, 0x80,0x00,0x03,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x17,0xFF,0xF7,0x80,0x00,0x01, 0x80,0x00,0x01,0x80,0x00,0x0C,0x00,0x00,0x00,0x00,0x17,0xFF,0xF7,0x00,0x00,0x01, 0x80,0x00,0x01,0x80,0x00,0x04,0x00,0x00,0x00,0x00,0x09,0xFF,0xEF,0x00,0x00,0x01, 0x80,0x00,0x00,0xC0,0x00,0xF6,0x00,0x00,0x00,0x00,0x06,0x7F,0xEE,0x00,0x00,0x01, 0x80,0x00,0x00,0xC0,0x03,0xC2,0x00,0x00,0x00,0x00,0x01,0x9F,0xDE,0x00,0x00,0x01, 0x80,0x00,0x00,0x60,0x00,0x3B,0x00,0x00,0x00,0x00,0x00,0x67,0xDF,0x00,0x00,0x01, 0x80,0x00,0x00,0x60,0x00,0xE3,0x00,0x00,0x00,0x00,0x00,0x19,0xBF,0x00,0x00,0x01, 0x80,0x00,0x00,0x30,0x03,0x8E,0x00,0x00,0x00,0x00,0x00,0x06,0x3F,0x00,0x00,0x01, 0x80,0x00,0x00,0x30,0x06,0x3C,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0x00,0x00,0x01, 0x80,0x00,0x00,0x18,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x01, 0x80,0x00,0x00,0x18,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x0F,0x7F,0x80,0x00,0x01, 0x80,0x00,0x00,0x0C,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x1F,0xC0,0x00,0x01, 0x80,0x00,0x00,0x0C,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x07,0xE0,0x00,0x01, 0x80,0x00,0x00,0x06,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1F,0xE0,0x00,0x01, 0x80,0x00,0x00,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x3F,0xC0,0x00,0x01, 0x80,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xFF,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF0,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x80,0x05,0x40,0x88,0x04,0x01,0x08,0x00,0x00,0x0A,0x81,0x10,0x04,0x00,0x20,0x01, 0x80,0x79,0x21,0x08,0x02,0x21,0x49,0x00,0x00,0xF2,0x42,0x10,0x04,0x47,0x10,0x01,0x80,0x09,0x07,0xDF,0x7F,0xF7,0xAA,0x00,0x00,0x12,0x0F,0xBE,0x7F,0xE5,0xFE,0x01,0x80,0x7F,0xF4,0x51,0x08,0x81,0x2C,0x00,0x00,0xFF,0xE8,0xA2,0x44,0x47,0x00,0x01,0x80,0x09,0x04,0x61,0x08,0x81,0x7F,0x00,0x00,0x12,0x08,0xC2,0x7F,0xC5,0x4A,0x01,0x80,0x0B,0x24,0x51,0x08,0x83,0x81,0x00,0x00,0x16,0x48,0xA2,0x44,0x45,0x6A,0x01,0x80,0x1D,0x47,0xC9,0x05,0x05,0x01,0x00,0x00,0x3A,0x8F,0x92,0x44,0x47,0x52,0x01,0x80,0x68,0x84,0x49,0x05,0x05,0x7F,0x00,0x00,0xD1,0x08,0x92,0x7F,0xC5,0x6A,0x01,0x80,0x09,0x94,0x41,0x02,0x01,0x01,0x00,0x00,0x13,0x28,0x82,0x44,0x05,0x4A,0x01,0x80,0x0E,0x57,0xC1,0x0D,0x81,0x01,0x00,0x00,0x1C,0xAF,0x82,0x04,0x29,0x42,0x01,0x80,0x38,0x34,0x4E,0x70,0x71,0x7F,0x00,0x00,0x70,0x68,0x9C,0x03,0xEB,0x7E,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};//图像数据unsigned char code ucPic2[]={/*-- 调入了一幅图像:C:\Users\Administrator\Desktop\光盘内容\13.工具软件\8X8点阵取字模软件\BMP图片\位图(1bit)\01.bmp --*//*-- 宽度x高度=128x64 --*/0x00,0x00,0x00,0x01,0x85,0xFD,0x7D,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x0B,0xD0,0x1B,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0B,0xE0,0x06,0xBF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1A,0x1F,0x80,0x01,0x5F,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x0F,0x00,0x00,0x15,0xFF,0xFF,0xFF,0xD0,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x14,0x5C,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xE0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x1E,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xB8,0x00,0x00,0x01,0x7F,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x38,0x00,0x00,0x00,0x9F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x60,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x70,0x00,0x00,0x00,0x1F,0xDF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0xC0,0x00,0x00,0x00,0x3F,0xDF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,0xE0,0x00,0x00,0x00,0x27,0xEF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x81,0xE0,0x00,0x00,0x00,0x0F,0xF7,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x89,0x70,0x00,0x00,0x00,0x05,0xF7,0xFF,0xFE,0x00,0x08,0xC0,0x00,0x00,0x00,0x05,0x13,0x18,0x00,0x00,0x00,0x03,0xFB,0xFF,0xFE,0x00,0x14,0x80,0x00,0x00,0x00,0x0A,0xA6,0x00,0x00,0x00,0x00,0x0B,0xFD,0xFF,0xFE,0x00,0x2E,0xC0,0x00, 0x00,0x00,0x06,0x17,0x80,0x00,0x00,0x00,0x02,0xFD,0xFF,0xFF,0x80,0x17,0x40,0x00, 0x00,0x10,0x15,0x27,0xE0,0x00,0x00,0x00,0x0F,0xFC,0xFF,0xFF,0x00,0x0D,0x80,0x00, 0x00,0x04,0x0E,0xAE,0x70,0x00,0x00,0x00,0x01,0xFE,0xFF,0xFF,0x80,0x05,0x00,0x00, 0x00,0x08,0x18,0x8E,0x78,0x00,0x00,0x00,0x0F,0xFE,0xFF,0xEF,0x80,0x02,0x00,0x00, 0x00,0x00,0x0D,0x4F,0x5C,0x00,0x03,0xF0,0x01,0xFF,0x7F,0xFF,0xC0,0x00,0x00,0x00, 0x00,0x00,0x16,0x91,0xB8,0x00,0x05,0xFE,0x07,0xFE,0x7F,0xF7,0xC0,0x00,0x04,0x00, 0x00,0x00,0x15,0x98,0x1C,0x00,0x00,0x0F,0x80,0xFF,0xBF,0xFF,0xE0,0x00,0x14,0x00, 0x00,0x00,0x2A,0xA0,0x00,0x00,0x00,0x01,0xC7,0xFF,0x7F,0xFB,0xE0,0x00,0x08,0x00, 0x00,0x00,0x25,0xA0,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0xFF,0xE0,0x00,0x00,0x00, 0x00,0x00,0x2F,0x40,0x00,0x00,0x06,0x80,0x42,0xFF,0xBF,0xFB,0xF0,0x00,0x00,0x00, 0x00,0x00,0x2B,0x80,0x00,0x00,0x0B,0xE0,0x2A,0xFF,0xDF,0xFF,0xF0,0x00,0x00,0x00, 0x00,0x00,0x37,0x00,0x00,0x00,0x33,0xF0,0x07,0xFF,0xBF,0xFC,0xF0,0x00,0x00,0x00, 0x00,0x00,0x2E,0x80,0x00,0x00,0x32,0xF8,0x00,0xFF,0xEF,0xFE,0xF8,0x00,0x00,0x00, 0x00,0x00,0x7D,0x00,0x00,0x00,0x03,0xD8,0x07,0xFF,0xBF,0xFF,0x38,0x00,0x68,0x00, 0x00,0x00,0x3D,0x00,0x00,0x00,0x03,0xBC,0x01,0xFF,0xDF,0xFF,0xB8,0x00,0x56,0x00, 0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x2C,0x0B,0xFF,0xFF,0xFF,0x98,0x00,0xFC,0x00, 0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x05,0xFF,0xDB,0xFF,0xDC,0x00,0x34,0x00, 0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xDF,0xFF,0xCC,0x00,0x28,0x00, 0x1B,0x00,0xDE,0x00,0x00,0x00,0x00,0x00,0x0B,0xFF,0xDF,0xFF,0xCC,0x00,0x10,0x00, 0x2A,0x81,0xFE,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0xED,0xFF,0x4C,0x00,0x00,0x00, 0x1F,0x80,0xFE,0x00,0x00,0x00,0x00,0x00,0x0B,0xFF,0xFF,0xFF,0xCE,0x00,0x00,0x00, 0x16,0x01,0xFE,0x00,0x00,0x00,0x00,0x00,0x57,0xFF,0xFD,0xFF,0xCC,0x00,0x00,0x00, 0x0A,0x01,0x7E,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0xBF,0xFF,0xC6,0x00,0x00,0x00, 0x04,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xBE,0xFF,0x8E,0x08,0x00,0x00, 0x00,0x01,0x7E,0x00,0x00,0x00,0x00,0x00,0x2F,0xEF,0xFF,0xFF,0xEE,0x02,0x00,0x00, 0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xEF,0x7F,0xCC,0x04,0x00,0x00, 0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xF7,0xFF,0xEE,0x00,0x00,0x00, 0x00,0x00,0x3B,0x00,0x00,0x00,0x00,0x00,0x7C,0xFF,0xEE,0xBF,0xCE,0x00,0x00,0x00, 0x00,0x00,0x1D,0x00,0x00,0x00,0x00,0x00,0xBF,0x3F,0xF7,0xFF,0xEE,0x00,0x00,0x00, 0x00,0x00,0x37,0x80,0x80,0x00,0x00,0x01,0x7F,0xFF,0xFF,0xDF,0xFC,0x00,0x00,0x00, 0x00,0x00,0x1B,0x80,0x60,0x00,0x00,0x00,0x7F,0xFF,0xF7,0xFF,0xFE,0x00,0x00,0x00, 0x00,0x00,0x1A,0x80,0x15,0x40,0x00,0x02,0xFF,0xFF,0xF7,0xBF,0xFC,0x00,0x00,0x00, 0x00,0x00,0x0A,0x40,0x0F,0xFC,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x0A,0x00, 0x00,0x00,0x08,0xC0,0x00,0xFC,0x00,0x02,0xFF,0xFF,0xFB,0xDF,0xF4,0x00,0x04,0x00, 0x00,0x00,0x04,0x40,0x01,0xE0,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00, 0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFB,0xDF,0xF8,0x00,0x00,0x00, 0x00,0x00,0x01,0x60,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xEF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xDF,0xF0,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFD,0xFF,0xD0,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xFF,0xEF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xF7,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF8,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFB,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFC,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xF7,0xF4,0x00,0x00,0x00,};unsigned char code ucPic3[]={/*-- 调入了一幅图像:C:\Users\Administrator\Desktop\光盘内容\13.工具软件\8X8点阵取字模软件\BMP图片\位图(1bit)\01.bmp --*//*-- 宽度x高度=128x64 --*/0x00,0x00,0x00,0x01,0x85,0xFD,0x7D,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x0B,0xD0,0x1B,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x0B,0xE0,0x06,0xBF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1A,0x1F,0x80,0x01,0x5F,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x0F,0x00,0x00,0x15,0xFF,0xFF,0xFF,0xD0,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x14,0x5C,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xE0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x1E,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xB8,0x00,0x00,0x01,0x7F,0xFF,0xFF,0xE8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31,0x38,0x00,0x00,0x00,0x9F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x60,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x70,0x00,0x00,0x00,0x1F,0xDF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0xC0,0x00,0x00,0x00,0x3F,0xDF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC1,0xE0,0x00,0x00,0x00,0x27,0xEF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x81,0xE0,0x00,0x00,0x00,0x0F,0xF7,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x89,0x70,0x00,0x00,0x00,0x05,0xF7,0xFF,0xFE,0x00,0x08,0xC0,0x00,0x00,0x00,0x05,0x13,0x18,0x00,0x00,0x00,0x03,0xFB,0xFF,0xFE,0x00,0x14,0x80,0x00,0x00,0x00,0x03,0x0B,0x04,0x00,0x00,0x00,0x05,0xFB,0xFF,0xFF,0x00,0x3F,0xE0,0x00,0x00,0x00,0x0A,0xA6,0x00,0x00,0x00,0x00,0x0B,0xFD,0xFF,0xFE,0x00,0x2E,0xC0,0x00,0x00,0x00,0x06,0x17,0x80,0x00,0x00,0x00,0x02,0xFD,0xFF,0xFF,0x80,0x17,0x40,0x00,0x00,0x10,0x15,0x27,0xE0,0x00,0x00,0x00,0x0F,0xFC,0xFF,0xFF,0x00,0x0D,0x80,0x00,0x00,0x04,0x0E,0xAE,0x70,0x00,0x00,0x00,0x01,0xFE,0xFF,0xFF,0x80,0x05,0x00,0x00,0x00,0x08,0x18,0x8E,0x78,0x00,0x00,0x00,0x0F,0xFE,0xFF,0xEF,0x80,0x02,0x00,0x00,0x00,0x00,0x0D,0x4F,0x5C,0x00,0x03,0xF0,0x01,0xFF,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x16,0x91,0xB8,0x00,0x05,0xFE,0x07,0xFE,0x7F,0xF7,0xC0,0x00,0x04,0x00,0x00,0x00,0x15,0x98,0x1C,0x00,0x00,0x0F,0x80,0xFF,0xBF,0xFF,0xE0,0x00,0x14,0x00,0x00,0x00,0x2A,0xA0,0x00,0x00,0x00,0x01,0xC7,0xFF,0x7F,0xFB,0xE0,0x00,0x08,0x00,0x00,0x00,0x25,0xA0,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x2F,0x40,0x00,0x00,0x06,0x80,0x42,0xFF,0xBF,0xFB,0xF0,0x00,0x00,0x00,0x00,0x00,0x2B,0x80,0x00,0x00,0x0B,0xE0,0x2A,0xFF,0xDF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x37,0x00,0x00,0x00,0x33,0xF0,0x07,0xFF,0xBF,0xFC,0xF0,0x00,0x00,0x00,0x00,0x00,0x2E,0x80,0x00,0x00,0x32,0xF8,0x00,0xFF,0xEF,0xFE,0xF8,0x00,0x00,0x00,0x00,0x00,0x7D,0x00,0x00,0x00,0x03,0xD8,0x07,0xFF,0xBF,0xFF,0x38,0x00,0x68,0x00,0x00,0x00,0x3D,0x00,0x00,0x00,0x03,0xBC,0x01,0xFF,0xDF,0xFF,0xB8,0x00,0x56,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x2C,0x0B,0xFF,0xFF,0xFF,0x98,0x00,0xFC,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x05,0xFF,0xDB,0xFF,0xDC,0x00,0x34,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xDF,0xFF,0xCC,0x00,0x28,0x00, 0x1B,0x00,0xDE,0x00,0x00,0x00,0x00,0x00,0x0B,0xFF,0xDF,0xFF,0xCC,0x00,0x10,0x00, 0x2A,0x81,0xFE,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0xED,0xFF,0x4C,0x00,0x00,0x00, 0x1F,0x80,0xFE,0x00,0x00,0x00,0x00,0x00,0x0B,0xFF,0xFF,0xFF,0xCE,0x00,0x00,0x00, 0x16,0x01,0xFE,0x00,0x00,0x00,0x00,0x00,0x57,0xFF,0xFD,0xFF,0xCC,0x00,0x00,0x00, 0x0A,0x01,0x7E,0x00,0x00,0x00,0x00,0x00,0x17,0xFF,0xBF,0xFF,0xC6,0x00,0x00,0x00, 0x04,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xBE,0xFF,0x8E,0x08,0x00,0x00, 0x00,0x01,0x7E,0x00,0x00,0x00,0x00,0x00,0x2F,0xEF,0xFF,0xFF,0xEE,0x02,0x00,0x00, 0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xEF,0x7F,0xCC,0x04,0x00,0x00, 0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x5F,0xFF,0xF7,0xFF,0xEE,0x00,0x00,0x00, 0x00,0x00,0x3B,0x00,0x00,0x00,0x00,0x00,0x7C,0xFF,0xEE,0xBF,0xCE,0x00,0x00,0x00, 0x00,0x00,0x1D,0x00,0x00,0x00,0x00,0x00,0xBF,0x3F,0xF7,0xFF,0xEE,0x00,0x00,0x00, 0x00,0x00,0x37,0x80,0x80,0x00,0x00,0x01,0x7F,0xFF,0xFF,0xDF,0xFC,0x00,0x00,0x00, 0x00,0x00,0x1B,0x80,0x60,0x00,0x80,0x00,0x7F,0xFF,0xF7,0xFF,0xFE,0x00,0x00,0x00, 0x00,0x00,0x1A,0x80,0x15,0x43,0x00,0x02,0xFF,0xFF,0xF7,0xBF,0xFC,0x00,0x00,0x00, 0x00,0x00,0x0A,0x40,0x0F,0xFE,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x0A,0x00, 0x00,0x00,0x08,0xC0,0x00,0xFC,0x00,0x02,0xFF,0xFF,0xFB,0xDF,0xF4,0x00,0x04,0x00, 0x00,0x00,0x04,0x40,0x01,0xE0,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00, 0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFB,0xDF,0xF8,0x00,0x00,0x00, 0x00,0x00,0x01,0x60,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xEF,0xF8,0x00,0x00,0x00, 0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xDF,0xF0,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFD,0xFF,0xD0,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0xBF,0xFF,0xFF,0xFF,0xEF,0xE0,0x00,0x00,0x00, 0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xF7,0xFC,0x00,0x00,0x00, 0x00,0x00,0x00,0x3F,0xF8,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFB,0x00,0x00,0x00, 0x00,0x00,0x00,0x7F,0xFC,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xF7,0xF4,0x00,0x00,0x00, };/*unsigned char code ucPic4[]={/*-- 调入了一幅图像:这是您新建的图像--*//*-- 宽度x高度=128x64 --*//*0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,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F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};/****************************************************************************** 函数名称:main函数功能:主函数,程序如路口入口参数:无返回值:无备注:无******************************************************************************* /void main(void){LCD12864_Init(); //初始化液晶//LCD12864_DisplayImage(ucPic);while(1){LCD12864_DisplayImage(ucPic);Delay(80000);LCD12864_DisplayImage(ucPic1);Delay(80000);LCD12864_DisplayImage(ucPic2);Delay(80000);LCD12864_DisplayImage(ucPic3);Delay(80000);// LCD12864_DisplayImage(ucPic4);};}/****************************************************************************** 函数名称:LCD12864_WriteInfomation函数功能:向LCD12864写入命令或者数据入口参数:ucData-要写入液晶的数据或者命令的内容bComOrData-命令或者数据的标志位选择,0或者1,其中1:写入的是数据0:写入的是命令返回值:无备注:无******************************************************************************* /void LCD12864_WriteInfomation(unsigned char ucData,bit bComOrData){LCD12864_CheckBusy();//忙检测LCD12864_RW = 0;//拉低RWLCD12864_RS = bComOrData;//根据标志位判断写入的是命令还是数据Delay(10); //延时,等待操作LCDPORT = ucData; //将数据送至数据端口LCD12864_EN = 1; //使能信号Delay(10); //延时LCD12864_EN = 0;//按照时序来操作Delay(10);}/****************************************************************************** 函数名称:LCD12864_Init函数功能:LCD12864液晶初始化入口参数:无返回值:无备注:无******************************************************************************* /void LCD12864_Init(void){Delay(400);//延时LCD12864_PSB = 1;//8位并口工作模式Delay(150);//延时。