12864汉字显示和图片显示
吴鉴鹰单片机项目项目实战精讲之12864系列基于单片机驱动12864的滚动文字以及漫画图片的显示
吴鉴鹰单片机项目项目实战精讲之12864系列基于单片机驱动12864的滚动文字以及漫画图片的显示备注:相关原理图百度文库可以找到陪伴我长大的小伙伴多啦a梦首先吴鉴鹰让大家来欣赏几张漫画图片,重温一下童年的的美好时光。
这是一只可爱的老虎,可能也就画的比较可爱而已。
这是少儿的偶像喜羊羊鹰哥当时就产生了一个想法,作为一个学电子的专业的学生,能不能用液晶屏将这些图片显示出来呢?于是尝试着用12864显示着,事实证明效果还是可以的。
所以要相信电子行业很多东西,只有你想不到,没有做不到的,要敢想敢做。
下面鹰哥再带大家欣赏一下12864显示的效果:多啦A梦可爱的小老虎小狗显示喜羊羊小猫又像小老虎下面是相应的美女显示程序,只要你愿意做你也可以显示你的女神哦!程序介绍:1/******************************************************2*程序:LCD12664液晶显示原理3*4**这一讲的主要内容:LCD12664液晶显示原理5**功能描述:对滚动汉字和漫画图片的LCD12864的显示6**输入:7**液晶:Proteus元件库—AMPIRE128X64(无字库)8**内容:显示滚动汉字和漫画图片9**输出:10**11**全局变量:12**调用模块:13**14**作者:吴鉴鹰15**日期:14.03.121617备注:有什么错误的地方,欢迎各大烧友指正1819O(∩_∩)O~20*******************************************************/2122#include<AT89X52.h>23#include<intrins.h>24#include<math.h>25//#include"source.h"26#define uchar unsigned char27#define uint unsigned int2829#define LCD_databus P0//LCD12864的8位数据口3031sbit LCD_RS_OUT=P2^2;//LCD_RS_OUT为0---命令;1----数据32sbit LCD_RW_OUT=P2^1;//LCD_RW_OUT为1---写;0---读33sbit LCD_EN_OUT=P2^0;//使能端34sbit LCD_CS1_OUT=P2^4;//片选1低电平有效,控制左半屏35sbit LCD_CS2_OUT=P2^3;//片选1低电平有效,控制右半屏3637sbit KK_KEY1_OUT=P3^0;38sbit KK_KEY2_OUT=P3^1;39sbit KK_KEY3_OUT=P3^2;40sbit KK_KEY4_OUT=P3^3;41sbit KK_KEY5_OUT=P3^4;42sbit KK_KEY6_OUT=P3^5;43sbit KK_KEY7_OUT=P3^6;4445//五个按键控制口4647void CHECK_busy();4849uchar coderrrr_table[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,500x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,510x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,520x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,530x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,540x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,550x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF8,560x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0xF8,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,570x00,0x00,0x00,0x0E,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x03,0x87,0x13,0x00,0x00,0x00,0x00,0x00,0x00,580x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x03,0xF7,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x30,0x0E,0x30,590x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x78,0x1C,0x78,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,600x00,0x3C,0xFC,0x38,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x79,0xDE,0x71,0xDE,0x00,0x00,0x00,0x00,0x00,0x00,610x00,0x00,0x00,0x00,0x00,0x00,0x79,0x9E,0x79,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x3C,0x3C,0x3C,0x3C,0x00,620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x3B,0x9E,0x78,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,630x0F,0xF7,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07, 0xEF,0x37,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,640x00,0x00,0x00,0x00,0x00,0x03,0xDE,0x7B,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x01,0xBC,0xFD,0x80,0x00,0x00,650x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0xDE,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,660x79,0x8E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C, 0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,670x00,0x00,0x00,0x00,0x00,0x1E,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x0F,0xF0,0x00,0x00,0x00,0x00,680x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,690xC0,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,700x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,710x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,720x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,730x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x20,740x00,0x01,0x9C,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0xC0,0x00,0x99,0x00,0x00,0x30,0x00, 0x03,0x9A,0x00,0x0C,0x23,0x00,0x00,0x00,0x02,0xC6,750x00,0x99,0x80,0x06,0xB4,0x00,0x02,0x21,0x00,0x06,0x33,0x00,0x10,0x80,0x07,0x26,0x00, 0x98,0x00,0x12,0x88,0x00,0x02,0x24,0x80,0x06,0x3F,760x00,0x1F,0xC0,0x05,0x26,0x00,0x15,0x00,0x1C,0x00,0x00,0x03,0x66,0x70,0x17,0x67,0x00, 0x0F,0x00,0x01,0xBE,0x00,0x02,0x00,0x0E,0x70,0x00,770x03,0x7E,0x00,0x17,0xE2,0x00,0x07,0x00,0x07,0x00,0x01,0xA0,0x40,0x18,0x00,0x00,0x06, 0xCE,0x00,0x0E,0x62,0x00,0x07,0x00,0x03,0xA6,0x00,780x9C,0x80,0x12,0x38,0x00,0x06,0x0F,0x80,0x06,0x62,0x00,0x06,0x00,0x03,0x08,0x00,0x84, 0x00,0x10,0xF0,0x00,0x0C,0xFC,0x00,0x06,0x22,0x00,790x1E,0x00,0x05,0x1C,0x00,0x1E,0x00,0x10,0x40,0x00,0x12,0x24,0x80,0x3E,0x42,0x00,0x1E, 0x00,0x01,0x1C,0x00,0x04,0x00,0x10,0x80,0x00,0x02,800x44,0xC0,0x3C,0x43,0x00,0x7F,0xF0,0x01,0x0E,0x00,0x04,0x00,0x11,0x10,0x80,0x02,0x64, 0x80,0x00,0x03,0x00,0x20,0x00,0x00,0xFA,0x80,0x08,810x00,0x13,0x08,0x80,0x02,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x18,0x00, 0x00,0x07,0x00,0x02,0x0C,0x00,0x00,0x00,0x00,0x00,820x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,830x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,840x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,850x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,860x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,870x00,0x00};8889unsigned char code picture_DIS[][64]={/*--调入了一幅图像:E:\学习资料\专业课程相关资料\单片机学习\吴鉴鹰单片机项目详细解析\12864项目系列\LCD12864显示\Proteus_12864程序包\12864美女图片显示\图片\1888-11120210532720.bmp--*/90/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\50406c075de5b_600x.bmp --*/91/*--宽度x高度=128x64--*/920x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,930x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,940x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,950x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,960x00,0x80,0x80,0xF0,0x1C,0x0C,0x06,0x02,0x02,0x03,0x03,0x01,0x01,0x01,0x01,0x03,970x03,0x02,0x06,0x06,0x0C,0xB8,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,980x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,990x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1000x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0x40,0x40,0x40,0x40,0xC0,0x80,0x80,0x00,0x00, 1010x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1020x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1030x00,0x00,0x80,0x80,0xC0,0xC0,0x60,0x20,0x30,0x10,0x18,0x0C,0x0C,0x06,0x06,0x03, 1040x03,0x01,0x01,0x81,0x83,0xC6,0xCC,0xEC,0xF8,0xF8,0xF8,0xF8,0xF8,0x58,0x58,0x78, 1050x78,0x78,0x6C,0x2E,0xAE,0xEB,0x69,0x38,0x3C,0x1C,0x1C,0x1C,0x1C,0x18,0x18,0x18, 1060x18,0x18,0x38,0x38,0x78,0xF8,0xD8,0x90,0x90,0xB0,0x30,0x20,0x20,0x60,0x60,0xC0, 1070xC0,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1080x00,0xFC,0x0F,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFD,0x0F,0x06,0x04, 1090x04,0x04,0x04,0x0C,0x0C,0x08,0x08,0x08,0x0C,0x8C,0x8C,0xCC,0xCC,0x44,0x64,0x64, 1100x24,0x24,0x24,0x24,0x34,0x34,0x34,0x24,0x24,0x24,0x24,0x24,0x64,0x64,0xC6,0xC6, 1110x87,0x87,0x05,0x05,0x00,0xC0,0xE0,0xF0,0xF8,0xF8,0xF8,0x78,0x38,0x1C,0x1C,0x0E, 1120x0E,0x07,0x07,0x83,0x83,0xC1,0xC1,0xE1,0xE0,0xF0,0xF0,0xF8,0xF8,0xF8,0xFC,0xFC, 1130xFE,0xFE,0xFE,0xFF,0xFF,0x81,0x00,0x0F,0xFC,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF, 1140x00,0x00,0x00,0x02,0x03,0x03,0xE0,0x78,0x1F,0x01,0x03,0x03,0x06,0x0C,0x1C,0x78, 1150xE0,0xC0,0x01,0x01,0x03,0x06,0x06,0x0C,0x18,0x30,0x70,0xE0,0x80,0x00,0x00,0x00, 1160x00,0x3F,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xE0,0x80,0x80,0x00, 1170x00,0x00,0x00,0xE0,0xF0,0x1C,0x0E,0x86,0xE3,0x31,0x19,0x0C,0x0C,0x06,0x02,0x02, 1180x03,0x03,0x01,0x01,0x01,0xF1,0xFF,0x00,0x00,0x00,0x80,0x80,0xC0,0xC0,0xC0,0x40, 1190x40,0xC1,0xC3,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x01,0x00,0xC0,0xF0,0xF8,0xFC, 1200xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 1210xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xE0,0x00,0x07,0x3E,0x00,0x00,0x00,0x00,0x3F, 1220x00,0x00,0x00,0x70,0x3C,0x07,0x83,0x80,0x80,0x80,0x80,0xF0,0xB8,0x0C,0x04,0x06, 1230x82,0x83,0x82,0xC3,0xC3,0xC3,0x83,0x82,0x02,0x02,0x06,0x04,0x0F,0xBF,0xFC,0xF0, 1240x00,0x00,0xC0,0xE1,0x31,0x13,0x12,0x12,0x12,0x13,0x13,0xF1,0xE1,0x61,0x31,0x3F, 1250x0E,0x00,0x00,0xFF,0xE0,0x00,0x0C,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1260x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x0E,0x1F,0x37,0x65,0x6C,0x4E,0x4E,0x4C, 1270x40,0xFF,0xFF,0xFF,0xE1,0xF3,0xFF,0xFF,0xFF,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF, 1280xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 1290xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x04,0x04,0x84,0x84,0x04,0x04,0x84,0x84, 1300x04,0x04,0x04,0x84,0x9F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7B,0xFB,0x7F,0x3F,0x1F,0x0E, 1310x2D,0x7F,0x7F,0x7F,0x77,0x77,0x7F,0x7D,0x0C,0x0C,0x0E,0x1E,0x1B,0x73,0xE1,0xFF, 1320x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x81,0x00,0x00,0x00, 1330x00,0x00,0x00,0x00,0x03,0x07,0x0E,0x1C,0x19,0x33,0x66,0x64,0x4C,0xD8,0xD8,0x90, 1340x90,0xB0,0xB0,0xA0,0x20,0x23,0x3F,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0xC0,0xC0, 1350x60,0x30,0x38,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0xC0,0x00,0x00,0x03,0x07,0x0F,1360x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 1370xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x01,0x00,0xE0,0x7F,0x03,0x00,0x00,0x00,0xFF, 1380x80,0x00,0x00,0x00,0x03,0x1E,0x78,0xC0,0x00,0x00,0x00,0x03,0x07,0x0C,0x0C,0x98, 1390xF8,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x18,0x98,0xCC,0xFE,0x3F,0x0F,0x03, 1400x00,0x1F,0x38,0x60,0x40,0xC0,0x80,0x80,0x80,0xC0,0xC0,0x63,0x7F,0x1C,0x08,0x08, 1410x08,0x08,0x08,0x0C,0x0C,0x04,0x04,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x08,0x08,0x08, 1420x88,0x89,0xC9,0xC9,0x49,0xC9,0xF9,0x39,0x19,0x09,0x09,0x09,0x08,0x08,0x08,0x08, 1430x08,0x8C,0x8C,0xC0,0x60,0x63,0x37,0x1F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0E,0x1E,0x1C, 1440x3C,0x38,0x78,0x70,0x50,0xF0,0xF0,0xA0,0xE1,0xE1,0x43,0x43,0x43,0xC7,0xC7,0xC7, 1450x8F,0x8F,0x8F,0x9F,0xFF,0xE0,0xC0,0x80,0x1F,0x03,0x00,0x00,0x00,0x00,0x00,0x3F, 1460x3F,0x00,0x00,0x08,0x98,0xF0,0xE0,0x63,0x2F,0x38,0x10,0x18,0x9C,0x8E,0x86,0xC3, 1470xC1,0x40,0x60,0x30,0x30,0x18,0x18,0x0C,0x06,0x03,0x03,0x01,0x00,0x00,0x00,0x00, 1480x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1490x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x3F, 1500x61,0xC1,0xC0,0x80,0x80,0x80,0x81,0x03,0x83,0x82,0x82,0x86,0xC6,0xC6,0x62,0x3F, 1510x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1520x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x03,0x03,0x02,0x02, 1530x02,0x06,0x06,0x06,0x04,0x04,0x05,0x05,0x07,0x07,0x06,0x06,0x06,0x06,0x06,0x06, 1540x06,0x06,0x07,0x07,0x07,0x03,0x02,0x02,0x03,0x03,0x03,0x01,0x01,0x01,0x00,0x00, 1550x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 156};157158159unsigned char code picture_DIS_ONE[][64]={160/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\20070708032327421.bmp --*/161/*--宽度x高度=128x64--*/1620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1630x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1640x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1650x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1660x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1670x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 1680x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x7C,0xF8,0xEC,0xFF,0xDF,0xCE,0xCE,0xCE, 1690xC0,0xC4,0xEC,0xFC,0xFC,0x6C,0x1C,0xF8,0xF8,0xF8,0xF0,0xE0,0xC0,0x80,0x80,0x00, 1700x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1710x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,1720x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1730x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,1740x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0xE0,0xE0, 1750xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xC0,0xC0, 1760xC0,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01, 1770x01,0x03,0x0F,0xFF,0xFF,0xFF,0xFB,0xFB,0xBD,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F8,0x00,0x00,0x03, 1910x1F,0xFF,0xFF,0xFC,0xF8,0x00,0x00,0x01,0x03,0xFF,0xFF,0xFF,0x0E,0x00,0x00,0x00, 1920xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0xEF,0xFF,0x3F,0x07,0x00,0x00,0x00,0x00,0x03, 1930x0F,0xFF,0xFF,0xF9,0xE1,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00, 1940x00,0x00,0x00,0x00,0x04,0x04,0x04,0x24,0x34,0x14,0x1F,0x1F,0x3D,0x3D,0xF7,0xE3, 1950xE4,0xE0,0xE0,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF,0xFF,0xBE,0x3E,0x5E,0xBC,0xAE,0xAF, 1960xF7,0xF3,0xF9,0x58,0x58,0xC8,0xC8,0xE9,0xF9,0xFB,0xFB,0xFB,0xFB,0x9B,0x1B,0x01, 1970x00,0x00,0x03,0x03,0x87,0xA7,0xB6,0x67,0x67,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0x40, 1980x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x3F,0x1F,0x1F,0x0F,0x00,0x00,0x00, 1990x00,0x0F,0x0F,0x0F,0x03,0x00,0x00,0x00,0x04,0x07,0x87,0x80,0x80,0x00,0x00,0x03, 2000x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,2010xFC,0xFF,0xFF,0x1F,0x0F,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2020x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0xBF, 2030xB7,0xB3,0xB0,0xB0,0xF0,0xF8,0xFC,0xDF,0xFF,0xF1,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF, 2040xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0xBF,0xBF,0xDF,0xFF,0x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00,0x00,0x01,0x01,0x03,0x03,0x07,0x07,0x0F,0x0E,0x0E,0x0E,0x0F,0x0F,0x0F,0x03, 2190x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2200x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2210x00,0x38,0x7C,0x7E,0x7F,0x67,0x73,0x7B,0xFB,0xDF,0xCF,0xC3,0xE1,0xF1,0xF1,0xF0, 2220xC0,0xC0,0xC0,0xE6,0xFF,0xFF,0x7F,0x73,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x03, 2230x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x03, 2240x03,0x03,0x07,0x0F,0x0F,0x1D,0x19,0x18,0x1F,0x1F,0x1F,0x3B,0x39,0x38,0x38,0x1C, 2250x1C,0x1F,0x0F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 226};227228unsigned char code picture_DIS_TWO[][64]={229/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\u=2035217269,1567906622&fm=21&gp=0.bmp--*/230/*--宽度x高度=128x64--*/2310x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x18,0x1C,0x1E,0x1F,0x1F, 2320x1E,0x1F,0x1F,0x1E,0x1E,0x0C,0x0C,0x18,0x10,0x10,0x10,0x10,0x10,0x18,0x88,0x8C, 2330x84,0x84,0x42,0x42,0x42,0x42,0xE2,0xC2,0x0A,0x0A,0x0A,0x0E,0x0C,0x7C,0x3C,0x08, 2340x08,0x88,0xD0,0x70,0x60,0x60,0x40,0x40,0x40,0x40,0xC0,0x80,0x80,0x00,0x00,0x00, 2350x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2360x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2370x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2380x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2390x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0F,0x1A,0x12,0x36,0x24,0x64,0x48,0xC0, 2400x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0x81,0x81,2410x01,0x03,0x02,0x06,0x06,0x07,0x01,0x00,0x00,0x00,0x00,0x80,0xC0,0x60,0x38,0x0E, 2420x03,0x01,0x00,0xC0,0xC0,0xC0,0xC0,0x00,0x06,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFE, 2430x04,0x0C,0x3C,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2440x00,0x00,0x00,0x00,0x00,0xE0,0xB8,0x0C,0x0C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00, 2450x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2460x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2470x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, 2480x80,0x81,0x83,0x86,0x84,0xBC,0xF8,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x19, 2490x18,0x03,0x07,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x8C,0x98,0xF0,0xE0, 2500x40,0x80,0x87,0x0F,0x0F,0x07,0x07,0x83,0x80,0xC3,0x43,0x43,0x60,0x61,0x21,0x31, 2510x10,0x18,0x0C,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2520x00,0x00,0x00,0x00,0x00,0x01,0x07,0x0C,0x18,0xF7,0xE7,0xCC,0x18,0x30,0xE0,0x80, 2530x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2540x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2550x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,0x4F, 2560x6F,0x3F,0x3F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0xBF,0xBE,0x3E,0x3E,0x3E,0x3E, 2570x3E,0x3E,0x3E,0xBE,0x9E,0x9E,0x9F,0x5F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x0F,0x1F, 2580x13,0x30,0x21,0x21,0x21,0x21,0x21,0x21,0x20,0x20,0xA0,0xA0,0xB0,0x90,0x90,0x90, 2590x90,0x90,0x98,0x88,0x88,0x88,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 2600x08,0x08,0x08,0x18,0x10,0x10,0x18,0x3C,0x26,0x23,0x63,0x63,0x60,0xF0,0xBC,0x07, 2610x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2630x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x07,0x0F,0x78,0xE0, 2640x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x7B,0x3B,0x81,0xF8,0x1C,0x06, 2650x02,0x02,0x7B,0xFD,0xFC,0xFE,0xFE,0x7E,0x7E,0x3E,0x1E,0x00,0x00,0x00,0x00,0x00, 2660x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x03,0x03,0x07,0x07,0x07,0x07,0x07, 2670x1F,0x3F,0x3F,0x3F,0x07,0x07,0x3F,0x3F,0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00, 2680x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x0E,0x0E,0x0E,0x04,0x00,0x00,0x00,0x01,0x03, 2690x02,0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2700x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2710x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2720x00,0x01,0x03,0x06,0x04,0x04,0x8C,0xC8,0x48,0x78,0x30,0x0C,0x07,0x83,0x80,0x00, 2730x00,0x00,0x03,0x07,0x07,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80, 2740x80,0xE0,0x7E,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2750x00,0x00,0x00,0x00,0x00,0x01,0x02,0x06,0x04,0x0C,0x08,0x18,0x30,0x20,0x20,0x40, 2760x40,0xC0,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x02,0x06,0x06,0x0E,0x0E,2770x0E,0x0C,0x0C,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x06,0x04,0x04,0x0C,0xCC,0xC8, 2780xC8,0x88,0x98,0x30,0x20,0x60,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 2790xC0,0xE0,0xB0,0xF0,0x50,0x78,0xA8,0x98,0xD8,0x58,0x58,0x58,0x50,0xF0,0xA0,0x20, 2800x30,0x30,0x18,0x0C,0x06,0x03,0x23,0x70,0x30,0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, 2940xF0,0xF0,0xFF,0xF1,0xF0,0xF0,0xF0,0xF0,0xD0,0xD0,0xD8,0xCC,0xC2,0xC3,0xC1,0xC0, 295};296297298unsigned char code picture_DIS_THREE[][64]={299/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\picture1240x3205580988506.bmp--*/300/*--宽度x高度=128x64--*/3010x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,3020x00,0x00,0x00,0xC0,0x60,0x20,0x10,0x10,0x18,0x08,0x08,0x08,0x08,0x04,0x04,0x04, 3030x04,0x04,0x08,0x08,0x08,0x08,0x18,0x90,0xF0,0xC0,0x00,0x00,0x3E,0x62,0x82,0xE1, 3040x81,0x81,0xC1,0x22,0x82,0x82,0xC6,0x6C,0x38,0x00,0x80,0x40,0x40,0x20,0x00,0x30, 3050x18,0x08,0x04,0x04,0x00,0x04,0x04,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,3060x02,0x01,0x01,0x01,0x02,0x02,0x06,0x04,0x06,0x02,0x02,0x02,0x04,0x06,0x0D,0x08, 3070x08,0x09,0x03,0x0A,0x0C,0x0C,0x18,0x30,0x20,0x20,0x20,0x20,0x40,0x80,0x80,0x80, 3080x80,0x80,0xC0,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0x3F,0x00,0x00, 3090x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,3100x00,0x00,0x03,0x06,0x0E,0x0C,0x1C,0x18,0x18,0x18,0x18,0x18,0xD8,0x38,0x38,0x58, 3110x58,0x5C,0x3C,0x1C,0x0E,0x0A,0x07,0x03,0x03,0x00,0x02,0x02,0x02,0x04,0x03,0x07,3120x07,0x0E,0x0A,0x0B,0x0B,0x13,0x96,0xD8,0xF8,0x30,0x37,0x18,0x90,0x90,0x90,0x90, 3130x90,0x90,0x20,0x00,0x20,0x10,0x10,0x00,0x00,0x10,0x18,0x08,0x84,0x84,0x84,0x44, 3140x46,0x44,0x4C,0x48,0xC8,0x88,0x88,0x0C,0x08,0x08,0x18,0x10,0x10,0x10,0xF0,0x40, 3150x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x03, 3160x03,0x07,0x07,0xCF,0xFF,0xFF,0xFF,0x7F,0x3F,0x1F,0x0F,0x03,0x01,0x00,0x00,0x00, 3170x80,0xC0,0xE0,0x60,0x30,0x30,0x18,0x38,0xFC,0xFC,0xFC,0xFC,0xFC,0x3C,0x3C,0x3C, 3180x78,0xF0,0x80,0x80,0x00,0x00,0xE0,0x30,0x1C,0x06,0x02,0x01,0x01,0x00,0x00,0x00, 3190x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x90,0x90,0xD8,0xC8,0xC8, 3200x18,0x10,0xF8,0x7C,0xDE,0x67,0x3B,0xCC,0x36,0x1A,0x87,0xC3,0xFF,0xFF,0xFF,0x1F, 3210xC7,0x33,0x8F,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x1E,0x21,0x40,0x5C,0x9E, 3220xBE,0xBE,0xBE,0x9A,0xDE,0x40,0x61,0x33,0x1E,0x00,0x00,0x00,0x80,0xF0,0x7F,0x9E, 3230x80,0xC0,0x7F,0x30,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3240x00,0x00,0x00,0x00,0x00,0x00,0x18,0x1D,0x16,0x30,0xE0,0x00,0x00,0x00,0x00,0x00, 3250x0F,0x09,0x08,0x08,0x08,0x08,0x08,0x08,0x0C,0x0F,0x07,0x07,0x07,0x02,0x02,0x06, 3260x04,0x0C,0x08,0x09,0x09,0x1D,0xFB,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3270x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x02,0x02,0x02,0x32, 3280xFE,0xFE,0xEF,0x18,0xE3,0x00,0xFF,0x00,0x00,0xF0,0xFF,0xFF,0xFF,0x0F,0xC0,0x78, 3290x07,0x1F,0x1F,0x3F,0x1F,0x1E,0x0F,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 3300x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x8E,0x03,0x01,0x00, 3310x00,0x00,0x00,0x00,0x03,0x02,0x04,0x00,0x04,0x04,0x08,0x00,0x00,0x00,0x00,0x00, 3320x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC4,0x4E,0x3B,0x00,0x00,0x00,0x00,0x00, 3330x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3340x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x02,0x02,0x04,0x04,0x04,0x04, 3350x08,0x00,0x08,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0xF0,0x98,0x08,0x08, 3360x0B,0x0F,0xFF,0xDC,0x71,0x43,0x47,0x4E,0x5F,0x5F,0x5F,0x5F,0x5F,0x98,0x0F,0x00, 3370x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x23,0x41,0x80,0xBC,0xBC,0xBE,0x3E,0xBC,0xBC, 3380x9C,0x41,0x63,0x3E,0x00,0x00,0x00,0x00,0x80,0xF0,0x7F,0x9C,0x83,0x46,0x44,0x38, 3390x18,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x18,0x08,0x04,0x00,0x00,0x00,0x00,0x00, 3400x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x11,0x1B,0x06,0x00,0x00,0x00,0x00,0x00,0x00, 3410x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3420x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3430x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x1C,0x30, 3440xE0,0x30,0x18,0x89,0x8F,0x06,0x04,0x04,0xE4,0x90,0x10,0x04,0x04,0x04,0x05,0x89, 3450x99,0x71,0x03,0x0C,0x08,0x00,0x08,0x08,0x08,0x18,0x10,0x10,0x10,0x10,0x08,0x08, 3460x08,0x08,0x18,0x08,0x0C,0x04,0x04,0x02,0x03,0x02,0x03,0x00,0x00,0x00,0x00,0x00, 3470x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0x40,3490x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3500x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3510x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3520x07,0x1F,0x31,0x40,0x40,0x7D,0x63,0x81,0x81,0x81,0x83,0x47,0x79,0x11,0x31,0x21, 3530x61,0x42,0xC2,0x82,0x84,0x04,0x04,0x04,0x08,0x08,0x18,0x90,0x60,0x40,0x40,0x40, 3540xC0,0x40,0x20,0x40,0x40,0x40,0x80,0x80,0xC0,0xC0,0x40,0x20,0x20,0x20,0x00,0x20, 3550x20,0x20,0x18,0x1C,0x1C,0x3C,0x7C,0xFC,0xFC,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFC, 3560xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3570x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3580x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3590x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3600x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3610x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00, 3620x03,0x06,0x02,0x02,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3630x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x1F,0x7F,0xFF,0xFF,0x7F,0x3F,0x1F, 3640x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 365366};367368369unsigned char code picture_DIS_FOUR[][64]={370/*--调入了一幅图像:C:\Users\Administrator\Desktop\新建文件夹\u=3745094681,1433150117&fm=21&gp=0.bmp--*/371/*--宽度x高度=128x64--*/3720x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3730x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3740x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3750x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x20,0x30,0x10,0x30,0x30,0x20, 3760x20,0x60,0x40,0x40,0x60,0x40,0x40,0x40,0x40,0x60,0x20,0x20,0xB0,0x90,0xD8,0xC8, 3770xC8,0x48,0x64,0x64,0x64,0xE6,0xA2,0xE2,0xB2,0xF2,0xF2,0xF2,0xF2,0xB2,0xB2,0xB2, 3780xB2,0xB2,0xB6,0xF4,0xF4,0x6C,0x28,0x08,0x08,0x0C,0x04,0x04,0x02,0x82,0xC2,0x42, 3790xC3,0xC1,0x01,0x01,0x01,0x83,0xE2,0x3E,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3800x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3810x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 3820x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,。
12864液晶图像显示图文教程——最全版
由图可以看到水平坐标一个单位是两字节(即 16 位 D15~D0),X 地址会自动加 1,是直接加一个单位 (即两字节 16 位),比如 0001(也即 0X80+000X80+01),从第一行第一列跳到第一行第二列。 代码: 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); //水平地址 for(j=0;j<16;j++) { write_data(*p);//连续写入 16 个字节 p++; } } /*下半屏半屏显示设置*/ for(i=0;i<32;i++)//下半屏 { write_cmd(0x80+i);//垂直地址 write_cmd(0x88);//水平地址 for(j=0;j<16;j++)//连续写入 16 个字节 { write_data(*p); p++; } } write_cmd(0x36);//开绘图显示 write_cmd(0x30);//回到基本指令集 } 源程序: #include <reg52.h> #include "12864.h" X 坐标(水平)方向以 2 字节 Byte 为单位,Y 坐标(垂直) 方向以 1 位 Bit 为单位,先连续写入垂直与水平坐标,再写入 两字节数据到 GDRAM。 这里是这样进行的:i=0 时,j=0,1 时,写入两字节到垂直 (0X80+00)水平(0X80+00)这格(D15~D0)里;然后 X 坐标地址自增 1, 地址变为垂直 (0X80+00) , 水平 (0X80+01) 这格,在 j=2,3 时写入两字节,………一直到垂直(0X80+00) 水平(0X80+07)这格,在 j=14,15 时写入两字节,此时循环 for(j=0;j<16;j++)结束跳出,刚好第一行 128 位写完数据;然后 i++,开始写第二行……
带字库LCD12864自定义图形、汉字显示
带字库的LCD12864自定义图片、汉字显示
一、将图片修改成128*64像素
1、打开win7自带的画图软件,载入图片(图片不满足128*64)
2、点击重新调整大小(或者图片处右击鼠标),如下设置,保持纵横比不勾选。
3、图片另存为,选择单色位图。
二、LCD12864用ZIMO21软件取模(BMP图片)
1、基本设置里面设置LCD的大小(如果图片像素就是128*64就不需要设置,直接打开)
2、打开BMP图片(黑白)
3、发现图片偏小,不足128*64,此时生成的数据就缺少128*64个点,显示会照成错误,需要修改一下图片大小。
改成128*64
3、直接调入128*64图片
4、设置参数,如下
5、取模选择C51格式
6、显示效果
三、PCtoLCD2002图片取模设置
四、PCtoLCD2002汉字取模设置(根据程序而定)
1、汉字取模参数设置
2、显示效果如下。
SG12864-12 液晶显示模块 使用说明书
深圳显能实业有限公司液晶显示模块SG12864-12使用说明书Add: 深圳市宝安33区大宝路83号东方明工业城6栋4楼目录一、功能特点----------------------------------------------3二、读写操作时序------------------------------------------3三、指令说明----------------------------------------------6四、坐标关系---------------------------------------------11五、显示RAM---------------------------------------------13六、应用举例---------------------------------------------14七、注意事项---------------------------------------------18一、功能特点:SG12864-12汉字图形点阵液晶显示模块,可显示汉字及图形,内置8192个中文汉字(16X16点阵)、128个字符(8X16点阵)及64X256点阵显示RAM(GDRAM)。
主要技术参数和显示特性:电源:VDD 3.3V~+5V(内置升压电路,无需负压);显示内容:128列× 64行显示颜色:黄绿屏,蓝屏显示角度:6:00钟直视LCD类型:STN与MCU接口:8位并口或串行配置LED背光多种软件功能:光标显示、画面移位、自定义字符、睡眠模式等二、读写操作时序:模块有并行和串行两种连接方法(时序如下):8位并行连接时序图MPU写资料到模块MPU从模块读出资料2、串行连接时序图串行数据传送共分三个字节完成:第一字节:串口控制—格式 11111ABCA为数据传送方向控制:H表示数据从LCD到MCU,L表示数据从MCU到LCDB为数据类型选择:H表示数据是显示数据,L表示数据是控制指令C固定为0第二字节:(并行)8位数据的高4位—格式 DDDD0000第三字节:(并行)8位数据的低4位—格式 0000DDDD串行接口时序参数:(测试条件:T=25℃ VDD=5.0V)三、指令说明:1、指令表1:(RE=0:基本指令集)指令码指令RS RWDB7DB6DB5DB4DB3DB2DB1DB说明执行时间(540KHZ)清除显示0 0 0 0 0 0 0 0 0 1将DDRAM填满“20H”,并且设定DDRAM的地址计数器(AC)到“00H”1.6ms地址归位0 0 0 0 0 0 0 0 1 X设定DDRAM的地址计数器(AC)到“00H”,并且将游标移到开头原点位置;这个指令并不改变DDRAM的内容72us进入点设定0 0 0 0 0 0 0 1 I/D S指定在资料的读取与写入时,设定游标移动方向及指定显示的移位I/D=1:游标向右移,DDRAM地址计数器(AC)加1I/D=0:游标向左移,DDRAM地址计数器(AC)减1S:显示画面整体位移72us显示状态开/关0 0 0 0 0 0 1 D C BD=1:整体显示ONC=1:游标ONB=1:游标位置ON72us游标或显示移位控制0 0 0 0 0 1S/CR/LX X设定游标的移动与显示的移位控制位元;这个指令并不改变DDRAM的内容S/C=0,R/L=0: 游标向左移动S/C=0,R/L=1:游标向右移动72us功能设定0 0 0 0 1 DL XREX XDL=1 (必须设为1)RE=1:扩充指令集动作RE=0:基本指令集动作72us设定CGRA M地址0 0 0 1AC5AC4AC3AC2AC1AC设定CGRAM地址到地址计数器(AC)72us设定0 0 1 AC AC AC AC AC AC AC设定DDRAM地址到地址计数器72usDDRAM地址6 5 4 3 2 1 0 (AC)读取忙碌标志(BF)和地址0 1 BFAC6AC5AC4AC3AC2AC1AC读取忙碌标志(BF)可以确认内部动作是否完成,同时可以读出地址计数器(AC)的值0us写资料到RAM 1 0 D7 D6 D5 D4 D3D2D1D0写入资料到内部的RAM(DDRAM/CGRAM/IRAM/GDRAM)72us读出RAM 的值1 1 D7 D6 D5 D4 D3D2D1D0从内部RAM读取资料(DDRAM/CGRAM/IRAM/GDRAM)72us指令表—2:(RE=1:扩充指令集)指令码指令RS RWDB7DB6DB5DB4DB3DB2DB1DB说明执行时间(540KHZ)待命模式0 0 0 0 0 0 0 0 0 1将DDRAM填满“20H”,并且设定DDRAM的地址计数器(AC)到“00H”72us卷动地址或IRAM地址选择0 0 0 0 0 0 0 0 1 SRSR=1:允许输入垂直卷动地址SR=0:允许输入IRAM地址72us反白选择0 0 0 0 0 0 0 1 R1 R0选择4行中的任一行作反白显示,并可决定反白与否72us睡眠模式0 0 0 0 0 0 1 SL X XSL=1:脱离睡眠模式SL=0:进入睡眠模式72us扩充功能设定0 0 0 0 1 1 X1REG 0RE=1:扩充指令集动作RE=0:基本指令集动作G=1 :绘图显示ONG=0 :绘图显示OFF72us设定IRAM地址或卷动地址0 0 0 1AC5AC4AC3AC2AC1ACSR=1:AC5—AC0为垂直卷动地址SR=0:AC3—AC0为ICONIRAM地址72us设定绘图RAM 地址0 0 1AC6AC5AC4AC3AC2AC1AC设定CGRAM地址到地址计数器(AC)72us备注:1、当模块在接受指令前,微处理顺必须先确认模块内部处于非忙碌状态,即读取BF标志时BF需为0,方可接受新的指令;如果在送出一个指令前并不检查BF标志,那么在前一个指令和这个指令中间必须延迟一段较长的时间,即是等待前一个指令确实执行完成,指令执行的时间请参考指令表中的个别指令说明。
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 );//提示信息显示}。
PG12864汉字显示
发现一个问题,字符显示方式与图形显示方式不能同时显示,不知哪出毛病了#include <avr/io.h>#define uchar unsigned char#define uint unsigned int#define WR_L() PORTD&=~(1)#define WR_H() PORTD|=(1)#define RD_L() PORTD&=~(1<<1)#define RD_H() PORTD|=(1<<1)#define CE_L() PORTD&=~(1<<2)#define CE_H() PORTD|=(1<<2)#define CD_L() PORTD&=~(1<<3)#define CD_H() PORTD|=(1<<3)#define RST_L() PORTD&=~(1<<4)#define RST_H() PORTD|=(1<<4)void delay(uint t);void init_txt_12864();void write_data(uchar data);void write_cmd1(uchar cmd);void write_cmd2(uchar data,uchar cmd);void write_cmd3(uchar data1,uchar data2,uchar cmd);uchar read_status();void check_status();void clear_screen();void display_char(uchar x,uchar y,uchar ch);void init_graphic_12864();void display_HZ(uchar x,uchar y,uchar *hz);////x 0-3 y 0-7void display_string(uchar x,uchar y,uchar *s);uchar HZ[4][32]={{0x00,0xF8,0x3F,0x90,0x12,0x10,0x09,0x20,0x3F,0xFE,0x22,0x02,0x42,0x0 0,0x3F,0xFC,0x04,0x00,0x07,0xF0,0x0C,0x20,0x0B,0x40,0x10,0xC0,0x63,0x 30,0x8C,0x0E,0x30,0x04},/*"爱",0*/{0x06,0x40,0x38,0x50,0x08,0x48,0x08,0x48,0x08,0x40,0xFF,0xFE,0x08,0x40 ,0x08,0x48,0x0E,0x28,0x38,0x30,0xC8,0x20,0x08,0x50,0x09,0x92,0x08,0x0 A,0x28,0x06,0x10,0x02},/*"我",1*/{0x01,0x00,0x01,0x00,0x21,0x08,0x3F,0xFC,0x21,0x08,0x21,0x08,0x21,0x08 ,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x01,0x00,0x01,0x00,0x01,0x00 ,0x01,0x00,0x01,0x00},/*"中",2*/{0x08,0x80,0x0C,0x88,0x10,0x9C,0x30,0xE0,0x53,0x80,0x90,0x84,0x10,0x8 4,0x10,0x7C,0x11,0x00,0x01,0x00,0x7F,0xFE,0x01,0x00,0x01,0x00,0x01,0x 00,0x01,0x00,0x01,0x00}/*"华",3*/};uchar HZ2[][32]={{0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x21,0x04,0x21,0x04, 0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x7F,0xFC, 0x20,0x04,0x00,0x00},/*"山",0*/{0x02,0x00,0x02,0x00,0x7F,0xFC,0x04,0x00,0x08,0x80,0x08,0x80,0x10,0x80 ,0x1F,0xF8,0x00,0x80,0x08,0xA0,0x0C,0x90,0x18,0x88,0x10,0x8C,0x22,0x8 4,0x01,0x80,0x00,0x80},/*"东",1*/{0x08,0x00,0x0B,0xFE,0x48,0x20,0x48,0x20,0x4B,0xFE,0x4A,0x22,0x4A,0x2 2,0x4A,0x22,0x4A,0x22,0x52,0x22,0x52,0x2A,0x12,0x24,0x20,0x20,0x40,0x2 0,0x80,0x20,0x00,0x20},/*"师",2*/{0x04,0x20,0x04,0x20,0xFF,0xFE,0x04,0x60,0x40,0x00,0x31,0xF8,0x91,0x0 8,0x61,0x08,0x49,0x08,0x09,0x38,0x11,0x10,0xE1,0x00,0x21,0x04,0x21,0x0 4,0x20,0xFC,0x20,0x00},/*"范",3*/{0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00 ,0x02,0x80,0x02,0x80,0x02,0x40,0x04,0x40,0x04,0x20,0x08,0x10,0x10,0x18, 0x20,0x0E,0x40,0x04},/*"大",4*/{0x01,0x08,0x10,0x8C,0x0C,0xC8,0x08,0x90,0x7F,0xFE,0x40,0x04,0x8F,0x E8,0x00,0x40,0x00,0x80,0x7F,0xFE,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x 80,0x02,0x80,0x01,0x00},/*"学",5*/{0x10,0x80,0x10,0x80,0x50,0x80,0x51,0xFC,0x7D,0x54,0x52,0x54,0x94,0x9 4,0x14,0x94,0x19,0x24,0x32,0x24,0xD4,0x44,0x10,0x84,0x11,0x04,0x12,0x0 4,0x14,0x28,0x00,0x10},/*"物",6*/{0x00,0x00,0x03,0xFC,0xFA,0x44,0x22,0x44,0x23,0xFC,0x22,0x44,0xFA,0x4 4,0x23,0xFC,0x22,0x44,0x20,0x40,0x23,0xFC,0x38,0x40,0xC0,0x40,0x00,0x 40,0x0F,0xFE,0x00,0x00},/*"理",7*/{0x00,0x00,0x08,0x00,0x08,0x04,0x0F,0xFE,0x08,0x00,0x08,0x00,0x0F,0xF C,0x00,0x04,0x00,0x04,0x00,0x24,0x7F,0xF4,0x00,0x04,0x00,0x04,0x00,0x4 8,0x00,0x30,0x00,0x00},/*"与",8*/{0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8 ,0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x01,0x02,0x01,0x02 ,0x00,0xFE,0x00,0x00},/*"电",9*/{0x00,0x00,0x3F,0xF0,0x00,0x20,0x00,0x40,0x00,0x80,0x01,0x00,0x01,0x00 ,0x01,0x04,0xFF,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00 ,0x05,0x00,0x02,0x00},/*"子",10*/{0x06,0x08,0x78,0x88,0x08,0x48,0x08,0x48,0xFE,0x08,0x18,0x88,0x1C,0x4 8,0x2A,0x48,0x28,0x0E,0x48,0x78,0x8B,0x88,0x08,0x08,0x08,0x08,0x08,0x0 8,0x08,0x08,0x08,0x08},/*"科",11*/{0x01,0x08,0x10,0x8C,0x0C,0xC8,0x08,0x90,0x7F,0xFE,0x40,0x04,0x8F,0x E8,0x00,0x40,0x00,0x80,0x7F,0xFE,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x 80,0x02,0x80,0x01,0x00},/*"学",12*/{0x01,0x08,0x10,0x8C,0x0C,0xC8,0x08,0x90,0x7F,0xFE,0x40,0x04,0x8F,0x E8,0x00,0x40,0x00,0x80,0x7F,0xFE,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x 80,0x02,0x80,0x01,0x00},/*"学",13*/{0x00,0x80,0xF8,0x40,0x8F,0xFE,0x94,0x04,0xA0,0x00,0xA3,0xF8,0x90,0x0 0,0x88,0x00,0x8F,0xFE,0xA9,0x20,0x91,0x20,0x81,0x20,0x82,0x22,0x82,0x2 2,0x84,0x22,0x88,0x1E}/*"院",14*/};uchar ch[]="/282280072/blog";int main(){uchar i,j=0;init_txt_12864();display_string(0,0,ch);delay(100);clear_screen();init_graphic_12864();for(i=0;i<4;i++)display_HZ(3,i,HZ[i]);for(i=0;i<15;i++)if(i>=8)display_HZ(1,i-8,HZ2[i]);elsedisplay_HZ(0,i,HZ2[i]);while(1);/*{//调整文本区首地址,可以实现移屏;//i++;write_cmd3(i++,0,0x40);//文本区首地址;delay(10000);}*/}//处在x y处显示汉字hzvoid display_HZ(uchar x,uchar y,uchar *hz)////x 0-3 y 0-7{uchar i,j=0;for(i=0;i<16;i++){write_cmd3(((j/2)<<4)|(y*2),x,0x24);//地址指针设置..低地址,高地址,命令write_cmd2(hz[j++],0xc0);write_cmd2(hz[j++],0xc0);}}//处在x y处显示chvoid display_char(uchar x,uchar y,uchar ch)//x 0-7 y 0-15{write_cmd3((((x*2)<<4)+y),0x00,0x24);//地址指针位置write_cmd2(ch-32,0xc0);//t6963c字符表与ASCII差32@@@@@@@@@@@@@@@@}void display_string(uchar x,uchar y,uchar *s){uchar i=0;while(*s){display_char( x, y+(i++),*s);s++;if(i>=16){x++;i=0;}}}void delay(uint t){uint i,j;for(i=0;i<t;i++)for(j=0;j<1141;j++);}void init_txt_12864(){//初始化端口DDRD=0XFF;DDRB=0XFF;PORTB=0XFF;//液晶复位RST_L();delay(1);RST_L();//所有控制引脚置高WR_H();RD_H();CE_H();CD_H();RST_H();//初始化指令check_status();write_cmd3(0x01,0x00,0x21);//光标指针设置check_status();write_cmd3(0x00,0x00,0x40);//文本区首地址check_status();//加上下面2行代码,只显示4行?而不是8行!!//write_cmd3(16,0x00,0x41);//文本区宽度。
12864中文图形点阵液晶显示模块使用说明书
72us
读出 RAM
的值
1 1 D7
D6
D5
D4
D3
D2
D1
D0
从 内 部 RAM 读 取 数 据 (DDRAM/CGRAM/GDRAM)
72us
指令表 2:(RE=1:扩充指令集)
指令
指令码
RS RW DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
说明
执行 时间 (540K HZ)
功能:设定 CGRAM 地址到地址计数器(AC),需确定扩充指令中 SR=0(卷动地址或 RAM 地址选择)
地址
设定 CGRAM 地址到地址计数器(AC)
1 AC5 AC4 AC3 AC2 AC1 AC0 需确定扩充指令中 SR=0(卷动地址或 72us RAM 地址选择)
设定 DDRAM 0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0 设定 DDRAM 地址到地址计数器(AC) 72us
I/O
DB5
I/O
DB6
I/O
DB7
I/O
PSB
I
NC
-
/RST
I
VEE
-
LED+
-
LED-
-
说明
电源地
逻辑电源正(+5V)
LCD 对比度调节电压
并行模式时选择数据或指令
H: 数据 L: 指令
串行模式时选择模块与否
H: 选择 L: 不选择
并行模式时控制读写
H: 读
L: 写
串行模式时输入数据
并行模式时使能端
L
L
L
H
DL
X
RE
X
12864显示文字+图像
引用12864液晶原理分析3他山之石2010-07-21 20:52:05 阅读7 评论0 字号:大中小小峰的12864液晶原理分析3一、ST7920控制IC的LCD12864实现反白显示从使用手册上可知,扩展指令里的0x03+行号即可实现反白对应行。
但是ST7920 控制器的128×64 点阵液晶其实原理上等同256×32 点阵,第三行对应的DDRAM 地址紧接第一行;第四行对应的DDRAM 地址紧接第二行。
所以128×64 点阵的液晶执行反白功能时实用意义不大,因为用户对第一行执行反白显示操作时,第三行必然也反白显示;第二行反白,第四行也必然反白。
其实还是有办法做到单行反白的,解决方法就是混用图形显示和字符显示。
其理论支持在于:在ST7920中,字符显示的DDRAM和图形的GDRAM是相互独立的,而最后显示到液晶上的结果,是两个RAM中数据的异或。
具体来说:假如某个点上,绘图RAM的没有绘图(数据为0),而字符RAM上有点阵(数据为1),那么异或的结果就是1,也就是说正常显示字符;当字符上RAM没有点阵的时候,异或的结果是0,自然也就不显示了。
假如该点上绘图RAM绘图了(数据为1),当字符RAM上有点阵(数据为1时),异或的结果为0,效果就是反白显示;如果字符RAM没有点阵(数据为0时),异或结果为1,效果就是显示绘图的背景。
所以,如果要在某个地方反白显示,那么就在该点绘图并且写字,如果要取消反白,就重新用全0擦掉那个地方的绘图!这样一来可以实现任何地方、任意大小的反白显示,反而比原指令中的单行反白的功能更好更强大。
二、对于整屏既有图象又有文本,则可以用两种方式实现:1、首先文本DDRAM写入要写的字符,其余全部空格(即0X00),然后再在没有字符的地方(即非点亮的晶格中,0X00)绘入图象。
DDRAM与GDRAM异或后就可以整屏实现图象与文本。
参见程序实例1。
12864显示图形和文字
/*******************************************************/
void lcd_out(unsigned char send_byte)
/*******************************************************/
void lcd_control()
{
WR_control(0x30);
WR_control(0x0C);
}
/*******************************************************/
/****** 参 数: 无 ******/
/****** 返回值 : 无 ******/
/*******************************************************/
{
bcd &= 0x0F;
if(bcd > 9)
bcd +=('7'); // 将A~F转换为ASCII
else
bcd += '0'; // 将0~9转换为ASCII 0~9
return(bcd);
{
unsigned char i,s;
for (i=0;i<8;i++)
{
if((send_byte&0x80)==0)
{
LCD_DATAL;
}
else
{
LCD_DATAH;
} //送数据
【最新编排】基于51单片机的C程序12864显示汉字和图形
#include<reg52.h>#define uchar unsigned char#define uint unsigned int#define X1 0x80#define X2 0x88#define Y 0x80sbit RS=P2^0; // 并行地指令/数据选择信号;串行地片选信号sbit RW=P2^1; // 并行地读写选择信号;串行地数据口sbit E=P2^2; // 并行地使能信号;sbit PSB=P2^3;// 串并行选择管脚sbit busy=P0^7;code char tab1【】={" 蒹葭苍苍 "" 白露为霜 "" 所谓伊人 "" 在水-方 "};code char tab2【】={" 我要减肥 "" 不吃晚饭 " };code char tab3【】={/*-- 宽度x高度=128x32 --小猪说"有重啦,要减肥啦"*/0x02,0x08,0x00,0x08,0x00,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x 00,0x00,0x00,0xD0,0x06,0x04,0x08,0x03,0x02,0x00,0x38,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x09,0x43,0x00,0x04,0xA1,0x80,0x41,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x29,0x00,0x00,0x14,0x80,0x00,0x8E,0x00,0xE7,0x00,0x00,0x00,0x00,0x00,0x32,0x88,0x29,0x30,0x04,0x14,0x98,0x00,0x70,0x00,0x1C,0x80,0x00,0x00,0x00,0x00,0x0C,0x00,0x16,0x48,0x00,0x0B,0x24,0x00,0x20,0x00,0x08,0x60,0x00,0x00,0x00,0x00,0x00,0x20,0x4D,0x80,0x00,0x26,0xC0,0x00,0x40,0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x40,0x20,0x00,0x10,0x00,0x00,0x08,0x00,0x4C,0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x04,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x08,0x20,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x09,0xC0,0x00,0x00,0x00,0x0 0,0x18,0x10,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x40,0x00,0x00,0x00,0x00,0x25,0x3F,0xC3,0xFE,0x3F,0xE0,0x00,0x01,0x10,0x04,0x00,0x40,0x00,0x00,0x00,0x00,0xA4,0x08,0x40,0x20,0x00,0x41,0x80,0x01,0x10,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0xA4,0xC8,0x47,0xFF,0x00,0x83,0xC0,0x01,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x59,0x28,0x40,0x20,0x03,0x03,0xC0,0x02,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x36,0x08,0x81,0xFC,0x02,0x03,0xC0,0x02,0xF0,0x40,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x44,0x81,0x24,0x02,0x01,0x80,0x05,0x0C,0x04,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x05,0x01,0xFC,0x02,0x01,0x80,0x05,0x42,0x00,0x14,0x40,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x24,0x02,0x00,0x00,0x05,0x51,0x00,0x1C,0x40,0x00,0x00,0x00,0x00,0x00,0x05,0x03,0xFE,0x02,0x01,0x80,0x04,0x91,0x03,0xC0,0x40,0x00,0x00,0x00,0x00,0x00,0x18,0xC0,0x20,0x02,0x01,0x80,0x04,0x61,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0x60,0x37,0xFF,0x0E,0x00,0x00,0x04,0x1E,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x40,0x7F,0xF4,0x0A,0x3B,0xF3,0xFE,0x01,0x01,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x38,0x05,0x02,0x0A,0x2A,0x90,0x04,0x00,0xC7,0xF8,0x02,0x00,0x00,0x00,0x00,0x00,0x04,0x3F,0xE2,0xFF,0x2A,0x90,0x08,0x00,0x70,0xF8,0x04,0x00,0x00,0x00,0x00,0x00,0x20,0x25,0x20,0x88,0x3A,0x90,0x30,0x00,0xC7,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE2,0xF9,0x2B,0xF0,0x20,0x01,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x02,0x89,0x2A,0x00,0x20,0x02,0x20,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x41,0x7F,0xF4,0xFA,0x3A,0x00,0x20,0x04,0x48,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x18,0x08,0x84,0xD4,0x2A,0x00,0x20,0x08,0x80,0x08,0x00,0x80,0x00,0x00,0x00,0x00,0x20,0x1D,0x05,0x75,0x2A,0x10,0x20,0x09,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,};//code char tab4【】={/*-- 宽度x高度=128x64 --九球天后--潘晓婷*//*0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF, 0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,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00,0xFF,0xFF,0xFF,0xC0,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xC0,0x01,0x09,0x60,0x80,0x00,0xFF,0xFF,0xFF,0x80,0xF8,0x03,0xFF,0xFF,0xFF,0x FF,0xC0,0x06,0x0F,0x03,0x80,0x00,0xFF,0xFF,0xFF,0x80,0x0F,0x81,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x01,0xC0,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x7F,0xFF, 0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x3F,0xFF, 0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x1F,0x00,0x00,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0xFF,0x80,0x07,0xFF, 0xFF,0xFF,0xC0,0x03,0xFE,0x07,0xE0,0x00,0xFF,0xFF,0xFF,0x00,0xEF,0x80,0x0F,0xFF, 0xFF,0xFF,0xC0,0x00,0x20,0x18,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x0F,0x80,0xAF,0xFF,0xFF,0xFF,0xC0,0x00,0x20,0x10,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x8F,0xFF,0xFF,0xFF,0xC0,0x00,0x20,0x1F,0xF0,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x87,0x9F,0xFF,0xFF,0xC0,0x07,0xFF,0x10,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x80,0x1F,0xFF,0xFF,0xC0,0x00,0x20,0x10,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x80,0x 1F,0xFF,0xFF,0xC0,0x00,0x50,0x17,0xE0,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0xC0,0x1F,0xFF,0xFF,0xC0,0x00,0x50,0x14,0x20,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x40,0x 1F,0xFF,0xFF,0xC0,0x00,0x88,0x24,0x20,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x60,0x3F,0xFF,0xFF,0xC0,0x01,0x04,0x27,0xE0,0x00,0xFF,0xFF,0xFF,0x00,0x01,0x00,0x70,0x3F,0xFF,0xFF,0xC0,0x06,0x03,0x44,0x20,0x00,0xFF,0xFF,0xFF,0x00,0x03,0x00,0x70,0x3F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x80,0x06,0x2D,0xF0,0x3F,0xC3,0x86,0xC0,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x80,0x0C,0x07,0xF8,0x7F, 0xC0,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0xDE,0xEF,0xFF,0x80,0x08,0x07,0xFE,0xFF,0xC0,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,0x07,0xFF,0x80,0x18,0x00,0x7F,0xFF,0xC0,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,0x07,0xFF,0xC0,0x00,0x00,0xFD,0xFF, 0xE0,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,0x07,0xFF,0xC0,0x00,0x3F,0xFD,0xFF, 0xFB,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xCF,0xFF,0xFF,0xC0,0x0F,0xCF,0xF8,0xFF, 0xFF,0xFF,0xC1,0x3F,0x80,0x40,0x42,0x00,0xFF,0xFF,0xFF,0xC0,0x04,0x00,0x70,0xFF,0xFF,0xFF,0xC0,0x95,0x1E,0x7C,0x5F,0xC0,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x71,0xFF,0xFF,0xFF,0xC0,0x0E,0x13,0xC9,0xE0,0x00,0xFF,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0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0xF1,0xFF,0xFF,0xF8,0x00,0xFF,0xFF,0xFF,0xF0,0x02,0xC0,0x00,0x00,0x00,0x00,0x00,0xF9,0xFF,0xFF,0xF8,0x00,0x7F,0xCF,0xFF, 0xF0,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0xF9,0xFF,0xFF,0xF8,0x00,0x3F,0xFF,0xFF, 0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xFF,0xFF,0xF8,0x00,0x1F,0xFF,0xFF,0xFF,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF7,0xFC,0x00,0x07,0xBF,0xFF, 0xFE,0x30,};*/void delay_nms(int z)//延时函数{int x,y;for(x=z;x>0;x--)for(y=240;y>0;y--);}void write_com(uchar com)//写指令函数{ RS=0;RW=0;E=1;P0=com;delay_nms(1);E=0;delay_nms(1);}void write_da(uchar da)//写数据函数{ RS=1;RW=0;E=1;P0=da;delay_nms(1);E=0;delay_nms(1);}/*----------整屏显示汉字程序---------------------*/void display_fchinese(uchar const *chn)//显示汉字程序{uchar i,j;write_com(0x30);write_com(0x80);//写第-行j=0;for(i=0;i<16;i++)write_da(chn【j*16+i】);write_com(0x90);//写第二行j=1;for(i=0;i<16;i++)write_da(chn【j*16+i】);write_com(0x88); //写第三行j=2;for(i=0;i<16;i++)write_da(chn【j*16+i】);write_com(0x98); //写第四行j=3;for(i=0;i<16;i++)write_da(chn【j*16+i】);}/*----------下半屏显示汉字程序---------------------*/ void display_dchinese(uchar const *chn){uchar i,j;write_com(0x88); //写第三行j=0;for(i=0;i<16;i++)write_da(chn【j*16+i】);write_com(0x98); //写第四行j=1;for(i=0;i<16;i++)write_da(chn【j*16+i】);write_com(0x36);//开显示}/*----------上半屏显示图像函数---------------------*/ void uimg_disp(uchar const *img){uchar i,j;for(j=0;j<32;j++){for(i=0;i<8;i++){write_com(0x34);//使用扩充指令集write_com(Y+j);write_com(X1+i);write_com(0x30);write_da(img【j*16+i*2】);write_da(img【j*16+i*2+1】);}}write_com(0x36);//开显示}/*----------整屏显示图像函数---------------------*/void fimg_disp(uchar const *img){uchar i,j;for(j=0;j<64;j++){for(i=0;i<8;i++){write_com(0x34);//使用扩充指令集write_com(Y+j);write_com(X1+i);write_com(0x30);write_da(img【j*16+i*2】);write_da(img【j*16+i*2+1】);}}write_com(0x36);//开显示}void inint_12864(void) //初始化{ PSB=1;//选择并行RW=0;//定义为写,本程序只用到了写write_com(0x30);//基本指令状态write_com(0x30); //选择8bit数据流write_com(0x0c); //开显示(无游标、不反白)write_com(0x01); //清除显示,并且设定地址指针为00H write_com(0x06);}void main(){uint i;inint_12864();write_com(0x01); //清除显示,并且设定地址指针为00H display_dchinese(tab2); // 下半屏显示汉字uimg_disp(tab3); // 上半屏显示图像//fimg_disp(tab4);//display_fchinese(tab1);while(1);}。
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 标识
LCD12864带中文字库图形显示单片机程序多图
LCD12864带中文字库图形显示-单片机程序(多图)代码:#include ;#define uchar unsigned charsbit rs=P2^2;//写指令/数据sbit rw=P2^3;//读状态/写sbit e=P2^4;//使能端sbit psb=P2^5;//串/并输入//校徽unsigned char code image[]={0x00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9D,0xE0,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x1F,0xBB,0xFC,0xFD,0xC0,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x0F,0xAA,0xBE,0xBF,0x00,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x03,0xEE,0xBE,0xBC,0x00,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x7E,0x9F,0xF0,0x00,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x0F,0xFF,0x00,0x00,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};void delay(int i){uchar j;while(i--)for(j=110;j>;0;j--);}//读状态,检测忙void check_busy(){rs=0;rw=1;e=1;P0=0xff;while((P0&0x80)==0x80);e=0;}//写指令void write_com(uchar com) {check_busy();rs=0;rw=0;e=1;P0=com;delay(5);e=0;delay(5);}//写数据void write_data(uchar _data) {check_busy();rs=1;rw=0;e=1;P0=_data;delay(5);e=0;delay(5);}//初始化lcdvoid init(){rw=0;psb=1;//选择为并行输入delay(50);write_com(0x30);//基本指令操作delay(5);write_com(0x0c);//显示开,关光标delay(5);write_com(0x06);//写入一个字符,地址加1 delay(5);write_com(0x01);delay(5);}void wstring(uchar *str){while(*str){write_data(*str);delay(5);str++;}}void lcd_draw(unsigned char code *pic) {unsigned i,j,k;write_com(0x34);//扩充指令集for(i=0;i绘图更好的一个算法:(可以绘分块,也可绘全屏)void lcd_block(char num,char flag){//x1:列数,yl:行数,x:列坐标,//sx:该图形距离第一幅图的距离//此函数也可以用来画全屏图unsigned i,j,k,xl,yl,x,y,sx;unsigned char code *pic;switch(num){case 0: j=0;pic=image0;xl=5;yl=12;sx=3;x=0x80|sx;break;case 1:j=13;pic=image4;xl=4;yl=37;sx=0;x=0x80|sx;break; case 2:j=13;pic=image4;xl=4;yl=37;sx=3;x=0x80|sx;break; case 3:j=13;pic=image4;xl=4;yl=12;sx=6;x=0x80|sx;break; case 4: j=7;pic=image4;xl=4;yl=31;sx=0;x=0x88|sx;break;case 5: j=7;pic=image5;xl=4;yl=31;sx=3;x=0x88|sx;break;case 6: j=7;pic=image5;xl=4;yl=31;sx=6;x=0x88|sx;break;case 7: j=0;pic=image7;xl=16;yl=64;sx=0;x=0x80|sx;break;}write_com(0x34);for(j;j;31) {y=j-32;x=0x88|sx;} else y=j;write_com(0x80+y);write_com(x);for(k=0;k<xl;k++){if(flag)write_data(*pic++);else write_data(~(*pic++));}}/*for(j;j<yl;j++){write_com(0x80+j);write_com(x);for(k=0;k<xl;k++){if(flag)write_data(*pic++);else write_data(~(*pic++));}}*/write_com(0x36);//显示图形write_com(0x30);//基本指令集}。
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,0xB1,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xFC,0x1C,0x1F,0xF0,0x00,0xFF,0xC5,0xF3,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xFE,0x1E,0x1F,0xF8,0x00,0xFF,0xE3,0xC3,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x07,0xFF,0x3E,0x3F,0xF8,0x00,0xFF,0xE3,0xE7,0xFF,0x00,0x00,0x00,0x00,0x00, 0x00,0x0F,0xFF,0xF3,0xFF,0xF8,0x00,0xFF,0xFE,0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0xC1,0xCF,0xFC,0x00,0xFF,0x9C,0x38,0xFF,0x80,0x00,0x00,0x00,0x00, 0x00,0x0F,0xE0,0x7F,0x83,0xFC,0x01,0xFE,0x0F,0xF0,0x3F,0x80,0x00,0x00,0x00,0x00, 0x00,0x1F,0xFF,0x00,0x3F,0xFC,0x01,0xFF,0xE0,0x07,0xFF,0x80,0x00,0x00,0x00,0x00, 0x00,0x1F,0xFF,0xFB,0xFF,0xFC,0x01,0xBF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00, 0x00,0x1F,0xFF,0xFF,0xFF,0xFC,0x01,0xDF,0xFF,0xFF,0xFB,0x80,0x00,0x00,0x00,0x00, 0x00,0x3F,0xFF,0xFF,0xFF,0xFC,0x03,0xC7,0xFF,0xFF,0xE7,0x80,0x00,0x00,0x00,0x00, 0x00,0x7F,0xFF,0xFF,0xFF,0xFC,0x07,0xC1,0xFF,0xFF,0x8F,0xC0,0x00,0x00,0x00,0x00, 0x00,0xFF,0xFF,0xFF,0xFF,0xFE,0x0F,0xE0,0x3F,0xFC,0x3F,0xC0,0x00,0x00,0x00,0x00, 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0xF8,0x00,0x00,0x7F,0xE0,0x00,0x00,0x00,0x00, 0x01,0xFC,0x7F,0xFF,0xFF,0x3F,0x1F,0x8E,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显示任意图形和字符
uchar Read_data()
{
uchar shuju;
P0=0xff;
rs=1;
// D/I=1,代表数据
rw=1;
// R/W=1.读取
delayms(10);
en=1;
delayms(100); shuju=P0; //读取当前显示的数据
en=0;
return(shuju);
}
/******************************************* 函数名称:Draw_TX 功 能:显示一个 16*16 大小的图形 参 数:Yaddr--Y 地址
uchar i,j,k;
Write_com(0x34);
//打开扩展指令集
i=0x80;
for(j=0;j<32;j++)
{
Write_com(i++);
Write_com(0x80);
for(k=0;k<16;k++)
{
Write_data(0x00);
}
}
i=0x80;
for(j=0;j<32;j++)
{
Write_com(i++);
Write_com(0x88);
for(k=0;k<16;k++)
{
Write_data(0x00);
}
} Write_com(0x30);
//回到基本指令集
}
/****************************
画点函数:Write_Point() x 表示列,y 表示为行。 ******************************/
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
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是用于寄存指令码,与数据寄存器数据相对应。
J12864中文液晶使用说明
J12864中文液晶使用说明
一、硬件连接
二、软件设置
1.安装液晶库文件
将液晶库文件拷贝到单片机的编程环境中,以便在程序中调用相关函数。
2.初始化液晶
在程序的初始化函数中,调用液晶库提供的初始化函数,以初始化液晶参数和相关引脚。
三、显示中文字符
然后,在程序中调用液晶库中的函数,以显示中文字符。
通常的调用方式为:
lcd_draw_chinese(x, y, "你好");
函数参数说明:
-x:起始横坐标
-y:起始纵坐标
-"你好":待显示的中文字符
四、显示英文字符和数字
显示英文字符和数字与显示中文字符类似,只是液晶库提供了额外的函数用于显示英文字符和数字。
调用方式如下:
显示英文字符:
lcd_draw_english(x, y, "Hello");
函数参数说明:
-x:起始横坐标
-y:起始纵坐标
- "Hello":待显示的英文字符
显示数字:
lcd_draw_number(x, y, number);
函数参数说明:
-x:起始横坐标
-y:起始纵坐标
- number:待显示的数字
五、显示图形
六、注意事项
2.操纵液晶模块时应轻拿轻放,避免撞击或扭曲。
3.在使用中文液晶时,应注意控制芯片ST7920的工作电压和时序要求。
4.如果需要显示中文字符,首先要将中文字库文件转换成液晶可识别的格式。
5.当在程序中使用液晶库进行液晶控制时,需注意调用顺序和参数的正确性。
总结:。
PG12864F汉字显示
Proteus仿真图:汉字用取模软件取得地址程序:#include <reg51.h>#define uchar unsigned char#define uint unsigned intsbit wr=P2^0;sbit rd=P2^1;sbit ce=P2^2;sbit cd=P2^3;sbit rst=P2^4;void delay(uint t);void init_12864();void write_data(uchar dat);void write_cmd1(uchar cmd);void write_cmd2(uchar dat,uchar cmd);void write_cmd3(uchar data1,uchar data2,uchar cmd); uchar read_status();void check_status();void clear_screen();void display_char(uchar x,uchar y,uchar ch);//注意汉字数组要加code放到外部存储器中,如果不加code则空间不够uchar code HZ0[6][32]={{/*-- 文字: 华--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/0x11,0x00,0x11,0x10,0x21,0x20,0x61,0xC0,0xA3,0x00,0x2D,0x08,0x21,0x08,0x20,0xF8, 0x22,0x00,0x02,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00,0x02,0x00},/*-- 文字: 东--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x04,0x00,0x04,0x00,0x7F,0xF0,0x08,0x00,0x12,0x00,0x22,0x00,0x3F,0xE0,0x02,0x00, 0x02,0x00,0x22,0x40,0x22,0x20,0x42,0x10,0x82,0x10,0x0E,0x00},/*-- 文字: 交--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x04,0x00,0x02,0x00,0xFF,0xF8,0x00,0x00,0x10,0x40,0x20,0x20,0x40,0x10,0x10,0x40, 0x08,0x80,0x05,0x00,0x02,0x00,0x05,0x00,0x18,0xC0,0xE0,0x38},/*-- 文字: 通--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x47,0xF0,0x21,0x20,0x20,0xC0,0x07,0xF0,0x04,0x90,0xE4,0x90,0x27,0xF0,0x24,0x90, 0x24,0x90,0x27,0xF0,0x24,0x90,0x24,0xB0,0x50,0x00,0x8F,0xF8},/*-- 文字: 大--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0xFF,0xF8,0x02,0x00,0x05,0x00,0x05,0x00, 0x05,0x00,0x08,0x80,0x08,0x80,0x10,0x40,0x20,0x20,0xC0,0x18},/*-- 文字: 学--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x24,0x20,0x12,0x40,0x00,0x80,0xFF,0xF8,0x80,0x08,0x80,0x08,0x3F,0xC0,0x00,0x80, 0x03,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00,0x02,0x00,0x0E,0x00}};uchar code HZ1[4][32]={/*-- 文字: 电--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x02,0x00,0x02,0x00,0x02,0x00,0x7F,0xF0,0x42,0x10,0x42,0x10,0x7F,0xF0,0x42,0x10,0x42,0x10,0x7F,0xF0,0x42,0x00,0x02,0x08,0x02,0x08,0x01,0xF8},/*-- 文字: 气--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x20,0x00,0x20,0x00,0x3F,0xF8,0x40,0x00,0x9F,0xE0,0x00,0x00,0x7F,0xE0,0x00,0x20, 0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x28,0x00,0x18,0x00,0x08},/*-- 文字: 学--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x24,0x20,0x12,0x40,0x00,0x80,0xFF,0xF8,0x80,0x08,0x80,0x08,0x3F,0xC0,0x00,0x80, 0x03,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00,0x02,0x00,0x0E,0x00},/*-- 文字: 院--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x00,0x80,0xF0,0x40,0x97,0xF8,0x94,0x08,0xA0,0x00,0xA3,0xF0,0x90,0x00,0x90,0x00, 0x97,0xF8,0x91,0x20,0xE1,0x20,0x82,0x20,0x84,0x28,0x88,0x18}};uchar code HZ2[6][32]={{/*-- 文字: 零--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/0x3F,0xE0,0x02,0x00,0xFF,0xF8,0x82,0x08,0xBA,0xE8,0x02,0x00,0x3A,0xE0,0x0D,0x80, 0x30,0x60,0xC2,0x18,0x1F,0xC0,0x00,0x80,0x1D,0x00,0x03,0x00},/*-- 文字: 七--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x78,0x07,0x80,0xFC,0x00,0x04,0x00, 0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x08,0x04,0x08,0x03,0xF8},/*-- 文字: 电--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x02,0x00,0x02,0x00,0x02,0x00,0x7F,0xF0,0x42,0x10,0x42,0x10,0x7F,0xF0,0x42,0x10, 0x42,0x10,0x7F,0xF0,0x42,0x00,0x02,0x08,0x02,0x08,0x01,0xF8},/*-- 文字: 牵--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x02,0x00,0x3F,0xE0,0x05,0x00,0x08,0x80,0x10,0x40,0xFF,0xF8,0x80,0x08,0x22,0x00, 0x3F,0xE0,0x42,0x00,0x02,0x00,0xFF,0xF8,0x02,0x00,0x02,0x00},/*-- 文字: 二--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x00,0x00,0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF8,0x00,0x00},/*-- 文字: 班--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x01,0x00,0xF9,0x78,0x21,0x20,0x25,0x20,0x25,0x20,0xFD,0x20,0x25,0x78,0x25,0x20, 0x29,0x20,0x21,0x20,0x3A,0x20,0xE2,0x20,0x04,0xF8,0x08,0x00}};uchar code HZ3[3][32]={{/*-- 文字: 占--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/0x04,0x00,0x04,0x00,0x04,0x00,0x07,0xF8,0x04,0x00,0x04,0x00,0x04,0x00,0x7F,0xE0, 0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x7F,0xE0,0x40,0x20},/*-- 文字: 俊--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x10,0x80,0x11,0x00,0x12,0x20,0x27,0xF0,0x20,0x10,0x62,0x20,0xA4,0x10,0x29,0x08, 0x21,0xE0,0x22,0x20,0x25,0x40,0x20,0x80,0x23,0x60,0x2C,0x18},/*-- 文字: 龙--*//*-- 楷体_GB231211; 此字体下对应的点阵为:宽x高=14x14 --*//*-- 宽度不是8的倍数,现调整为:宽度x高度=16x14 --*/{0x04,0x00,0x04,0x80,0x04,0x40,0x04,0x00,0xFF,0xF8,0x05,0x00,0x09,0x10,0x09,0x20, 0x09,0x40,0x11,0x80,0x11,0x00,0x23,0x08,0x4D,0x08,0x80,0xF8}};//汉字显示函数,处在x y处显示汉字hzvoid display_HZ(uchar x,uchar y,uchar *hz)////x 0-3 y 0-7{uchar i,j=0;for(i=0;i<16;i++){write_cmd3(((j/2)<<4)|(y*2),x,0x24);//地址指针设置..低地址,高地址,命令write_cmd2(hz[j++],0xc0);write_cmd2(hz[j++],0xc0);}}void main(){uchar i,j=0;init_12864();for(i=0;i<6;i++)display_HZ(0,1+i,HZ0[i]);//显示:华东交通大学for(i=0;i<4;i++)display_HZ(1,1+i,HZ1[i]);显示:电气学院for(i=0;i<6;i++)display_HZ(2,1+i,HZ2[i]);显示:零七电牵二班for(i=0;i<3;i++)display_HZ(3,2+i,HZ3[i]);显示:占俊龙//for(i=0;i<128;i++)//{// display_char(i/16,i%16,'0'+i);//}//clear_screen();}//显示字符函数,处在x y处显示chvoid display_char(uchar x,uchar y,uchar ch)//x 0-7 y 0-15{write_cmd3((((x*2)<<4)+y),0x00,0x24);//地址指针位置write_cmd2(ch-32,0xc0);//t6963c字符表与ASCII差32@@@@@@@@@@@@@@@@ }void delay(uint t){uint i,j;for(i=0;i<t;i++)for(j=0;j<50;j++);}void init_12864(){rst=1;delay(10);rst=0;wr=1;rd=1;ce=1;cd=1;rst=1;check_status();write_cmd3(0x01,0x00,0x21);//光标指针设置check_status();write_cmd3(0x00,0x00,0x42);//图形区首地址check_status();write_cmd3(16,0x00,0x43);//图形区宽度check_status();write_cmd1(0x80);//显示方式设置,正常显示check_status();//write_cmd1(0x94);//。