12864C程序及注释
12864液晶显示C语言程序设计实例
本文由g_olivebranch贡献 #include <reg51.h> #include 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,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,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,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,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, }; /*检查忙位*/ 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); //清除显示,并且设定地址指针为00H delay(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);//清除显示,并且设定地址指针为00H delay(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液晶万年历_C语言程序
#include<reg52.H>#include<intrins.h>#include<math.h>////////////////////////////////////////DS18B20#define uchar unsigned char#define uint unsigned intsbit DQ = P1 ^ 0; // 定义DS18B20的单总线#define Lcd_Bus P0sbit LCD_RS=P2^7; //数据/命令选择sbit LCD_RW=P2^6; //读写控制sbit LCD_EN=P2^5; //片选信号#define LCD_DA TA P0 //8 bit数据线#define LOW 0#define HIGH 1//初始化指令#define CLEAR_SCREEN 0x01 //清屏指令:清屏且AC值为00H#define AC_INIT 0x02 //将AC设置为00H。
且游标移到原点位置#define CURSE_ADD 0x06 //设定游标移到方向及图像整体移动方向(默认游标右移,图像整体不动)#define FUN_MODE 0x30 //工作模式:8位基本指令集#define DISPLAY_ON 0x0c //显示开,显示游标,且游标位置反白#define DISPLAY_OFF 0x08 //显示关#define CURSE_DIR 0x14 //游标向右移动:AC=AC+1#define SET_CG_AC 0x40 //设置AC,范围为:00H~3FH#define SET_DD_AC 0x80#define FUN_MODEK 0x36 //扩展指令集,8位指令#define X1address 0x80 //上半屏X轴起始地址#define X2address 0x88 //下半屏X轴起始地址#define Y address 0x80 //Y轴起始地址#define Set_Column 0x40#define Set_Page 0xB8uchar code shu[]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39};uchar code xingqi[]="星期";uchar code hanzishu[]="一二三四五六日";unsigned char TempData = 0;double DS18B20Data;uint jiemian=0;//////////////////////////////////////////DS1302sbit DS1302_RST = P1^4;sbit DS1302_IO = P1^3;sbit DS1302_SCK = P1^2;unsigned char table[]={0X00,0X18,0X0c,0X15,0X06,0X01,0X0a};//0s 24min 12hour 14ri 5yue 5zhou 2010nianunsigned char data table1[7];//uchar code table2[]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39};uchar code shuzi[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,};unsigned char aa,bb;uchar miaoge,miaoshi,fenge,fenshi,shige,shishi,rige,rishi,yuege,yueshi,zhou,niange,nianshi;uchar shezhinum=0;//unsigned char shi,ge;////////////////////////////////////////////////键盘扫描sbit key_mnue = P3^7;sbit key_jia = P2^0;sbit key_jian = P2^1;sbit key_enter= P2^2;uchar key_number=0;//int nian,yue,ri,shi,fen;/////////////////////////////////////////////////红外sbit HW_IRQ = P3 ^ 2; // 定义38KHz一体化红外接收头与CPU的连接unsigned char DT;static unsigned char data IRCode[3],IRCON,IRCON2;//////////////////////////////////////////////////蜂鸣器sbit BEEP =P1^1;/****************************************************************************** *************** 函数名称:DS18B20_Delay()* 功能:DS18B20软件延时专用* 入口参数:count 延时参数,值越大,延时越长* 出口参数:无******************************************************************************* **************/void DS18B20_Delay(uint count) //延时函数{while(count--);}/****************************************************************************** *************** 函数名称:DS18B20_Init()* 功能:DS18B20初始化* 入口参数:无* 出口参数:返回值为1则初始化成功* 返回值为0则初始化失败******************************************************************************* **************/uchar DS18B20_Init(void){uchar x = 0;DQ = 1; // DQ复位DS18B20_Delay(8); // 稍做延时DQ = 0; // 单片机将DQ拉低DS18B20_Delay(80); // 精确延时,大于480usDQ = 1; // 拉高总线DS18B20_Delay(14); // 稍做延时后x = DQ; // 若x=0则初始化成功,若x=1则初始化失败DS18B20_Delay(20);return (~x);}/****************************************************************************** *************** 函数名称:DS18B20_Read1Byte()* 功能:从DS18B20读一个字节* 入口参数:无* 出口参数:从DS18B20读出的一个字节******************************************************************************* **************/uchar DS18B20_Read1Byte(void){uchar i = 0;uchar dat = 0;for(i=8;i>0;i--){DQ = 0; // 给脉冲信号dat >>= 1;DQ = 1; // 给脉冲信号if(DQ) dat |= 0x80;DS18B20_Delay(4);}return (dat);}/****************************************************************************** *************** 函数名称:DS18B20_Write1Byte()* 功能:向DS18B20写一个字节* 入口参数:dat 要写入DS18B20的一字节数据* 出口参数:无******************************************************************************* **************/void DS18B20_Write1Byte(uchar dat){uchar i = 0;for(i=8;i>0;i--){DQ = 0;DQ = dat&0x01;DS18B20_Delay(5);DQ = 1;dat>>=1;}}/****************************************************************************** *************** 函数名称:Read_Disp_Temperature()* 功能:读取并显示温度* 入口参数:无* 出口参数:无******************************************************************************* **************/double Read_Disp_Temperature(void){uint a = 0, b = 0, c = 0,d = 0,e = 0, t = 0;double tt = 0;DS18B20_Init();DS18B20_Write1Byte(0xCC); // 跳过读序号列号的操作DS18B20_Write1Byte(0x44); // 启动温度转换DS18B20_Init();DS18B20_Write1Byte(0xCC); // 跳过读序号列号的操作DS18B20_Write1Byte(0xBE); // 读取温度寄存器a = DS18B20_Read1Byte();b = DS18B20_Read1Byte();t = b;t <<= 8;t = t | a;//tt = t * 0.0625;return t;}//***************************************************************** //函数名称:delay(uint t)延时函数。
12864液晶串行显示C程序
Temp_data = W_bits;
Temp_data <<= i;
if((Temp_data&0x80)==0) //bit7 is zero
{
SID = 0;
nop;
SCLK = 1;
nop;
nop;
SCLK = 0;
nop;
SID = 0;
}
else
//bit7 is one
{
SID = 1;
if(RW == 0) {
S_ID &=~ 0x04; } else //if(RW==1) {
S_ID |= 0X04; } if(RS == 0) {
S_ID &=~ 0x02; } else //if(RS==1) {
S_ID |= 0X02; } H_data = W_data; H_data &= 0xf0; //屏蔽低 4 位的数据 L_data = W_data; //xxxx0000 格式 L_data &= 0x0f; //屏蔽高 4 位的数据 L_data <<= 4; //xxxx0000 格式 CS = 1; Write_8bits(S_ID); //发送 S_ID Write_8bits(H_data); //发送 H_data Write_8bits(L_data); //发送 L_data CS = 0; } /******************************************************************** 函 数 名:Write_8bits 入口参数:W_bits 出口参数:无 函数作用:负责串行输出 8 个 bit 位 ********************************************************************/ void Write_8bits(uint W_bits) { uint i,Temp_data; for(i=0; i<8; i++) {
12864图形液晶显示器c程序
lcd12864图形液晶显示器c程序#define _LCD12864_E//#include"lcd12864.h"#include"dtype.h"#include<reg52.h>sbit lcd_rw=P2^0;sbit lcd_rs=P2^1;sbit lcd_cs2=P2^2;sbit lcd_cs1=P2^3;sbit lcd_e=P3^0;sbit lcd_busy=P0^7;INT8U lcd_page_grobal,lcd_line_grobal; /** 函数名称:lcd_LScreen()* 函数功能:选择显示屏的左半屏*/ void lcd_LScreen(){lcd_cs2=0;lcd_cs1=1;}/** 函数名称:lcd_RScreen()* 函数功能:选择显示屏的右半屏*/ void lcd_RScreen(){lcd_cs1=0;lcd_cs2=1;}/** 函数名称:lcd_ChkBusy()* 函数功能:查询忙状态*/void lcd_ChkBusy(){while(lcd_busy){lcd_e=0;lcd_rs=0;lcd_rw=1;P0=0xff;lcd_e=1;lcd_e=0;}}/* 函数名称:lcd_WriteCmd()* 函数功能:写命令cmd--待写命令*/void lcd_WriteCmd(const INT8U cmd){lcd_ChkBusy();lcd_rs=0;lcd_rw=0;P0=cmd;lcd_e=1;lcd_e=0;}/* 函数名称:lcd_WriteData()* 函数功能:写数据dat--待写数据*/void lcd_WriteData(const INT8U dat){lcd_ChkBusy();lcd_rs=1;lcd_rw=0;P0=dat;lcd_e=1;lcd_e=0;}/* 函数名称:lcd_StartLine()* 函数功能:设定起始行line--列号* 说明:用户需自己保证行号的有效性*/ void lcd_StartLine(INT8U line){INT8U tmp;tmp=line;tmp=tmp|0x40;lcd_WriteCmd(tmp);}/* 函数名称:lcd_StartPage()* 函数功能:设定起始页* 入口参数:page--页号* 说明:用户需自己保证页号的有效性*/ void lcd_StartPage(INT8U page){INT8U tmp;tmp=page;tmp|=0xb8;lcd_WriteCmd(tmp);}/* 函数名称:lcd_Ready()* 函数功能:显示屏初始化*/void lcd_Ready(){INT8U i,j;lcd_LScreen();lcd_WriteCmd(0x3f); //开显示lcd_RScreen();lcd_WriteCmd(0x3f); //开显示lcd_LScreen();for(i=0;i<8;i++){lcd_StartPage(i);lcd_StartLine(0);for(j=0;j<64;j++){lcd_WriteData(0);}}lcd_RScreen();for(i=0;i<8;i++){lcd_StartPage(i);lcd_StartLine(0);for(j=0;j<64;j++){lcd_WriteData(0);}}}/** 函数名称:lcd_Display(INT8U *ptr) * 函数功能:16*16显示* 入口参数:*ptr--图片数据指针lcd_page_grobal--页地址lcd_line_grobal--列地址调用方法:lcd_page_grobal=xx;lcd_line_grobal=xx;ptr=&picture;lcd_Ready();lcd_Display(ptr);*/void lcd_Display(INT8U *ptr){INT8U i,j;lcd_StartPage(lcd_page_grobal);lcd_StartLine(lcd_line_grobal);for(i=0;i<16;i++){lcd_WriteData(*ptr);ptr++;}lcd_StartPage(lcd_page_grobal+1);lcd_StartLine(lcd_line_grobal);for(j=0;j<16;j++){lcd_WriteData(*ptr);ptr++;}}void main( void ){lcd_page_grobal=xx;lcd_line_grobal=xx;ptr=&picture;lcd_Ready();lcd_Display(ptr);}。
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 );//提示信息显示}。
51单片机经典C程序(12864)
/*************************************** 控制器:KS0108* MCU:AT89C5* ,晶体频率:12MHz* 取模方式:纵向字节倒序* CS1和CS2为低电平有效**************************************/#include <reg52.h>#define uchar unsigned char#define uint unsigned int#define LCD_PORT P0#define Left 1#define Right 2sbit LCD_Busy=P0^7;sbit LCD_EN = P1^2;sbit LCD_RS = P1^0;sbit LCD_RW = P1^1;sbit LCD_RST= P1^7;sbit LCD_CS2= P3^6;sbit LCD_CS1= P3^5;uchar DisBuf[32],Page_Num,Clm_Num;code char Table0[]={/*-- 文字: A --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27 ,0x38,0x20,/*-- 文字: B --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11 ,0x0E,0x00,/*-- 文字: C --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10 ,0x08,0x00,/*-- 文字: D --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10 ,0x0F,0x00,/*-- 文字: E --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20 ,0x18,0x00,/*-- 文字: F --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00 ,0x00,0x00,/*-- 文字: G --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=8x16 --*/0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E ,0x02,0x00,};code unsigned char Table3[]={/*-- 文字: 天 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x40,0x42,0x42,0x42,0x42,0x42,0xFE,0x42,0x42,0x42,0x42,0x42,0x42 ,0x40,0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x06,0x01,0x02,0x04,0x08,0x10,0x30,0x60 ,0x20,0x00,/*-- 文字: 仙 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x80,0x60,0xF8,0x07,0x02,0xE0,0x00,0x00,0x00,0xFF,0x00,0x00,0x00 ,0xE0,0x00,0x01,0x00,0x00,0x7F,0x00,0x20,0x7F,0x20,0x20,0x20,0x3F,0x20,0x20,0x20 ,0x7F,0x00,/*-- 文字: 妹 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x88,0x7F,0x0A,0x08,0xF8,0x80,0x88,0x88,0x88,0xFF,0x88,0x88,0x88 ,0x80,0x00,0x40,0x21,0x12,0x0C,0x3A,0x11,0x40,0x30,0x0C,0x03,0xFF,0x06,0x08,0x30 ,0x10,0x00,/*-- 文字: 妹 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x88,0x7F,0x0A,0x08,0xF8,0x80,0x88,0x88,0x88,0xFF,0x88,0x88,0x88 ,0x80,0x00,0x40,0x21,0x12,0x0C,0x3A,0x11,0x40,0x30,0x0C,0x03,0xFF,0x06,0x08,0x30 ,0x10,0x00};code unsigned char Table4[]={/*-- 文字: 我 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x20,0x20,0x22,0x22,0xFE,0x21,0x21,0x20,0x20,0xFF,0x20,0x22,0xAC,0x20 ,0x20,0x00,0x04,0x04,0x42,0x82,0x7F,0x01,0x01,0x10,0x10,0x08,0x07,0x1A,0x21,0x40 ,0xF0,0x00,/*-- 文字: 好 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0xF0,0x1F,0x10,0xF0,0x80,0x82,0x82,0x82,0xF2,0x8A,0x86,0x82 ,0x80,0x00,0x80,0x43,0x22,0x14,0x0C,0x73,0x20,0x00,0x40,0x80,0x7F,0x00,0x00,0x00 ,0x00,0x00,/*-- 文字: 想 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0xC8,0x38,0xFF,0x18,0x68,0x08,0x00,0xFE,0x2A,0x2A,0x2A,0x2A,0xFE ,0x00,0x00,0x01,0x40,0x70,0x01,0x38,0x40,0x40,0x44,0x59,0x41,0x41,0x61,0x01,0x09 ,0x30,0x00,/*-- 文字: 你 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x80,0x40,0xF0,0x2C,0x43,0x20,0x98,0x0F,0x0A,0xE8,0x08,0x88,0x28,0x1C ,0x08,0x00,0x00,0x00,0x7F,0x00,0x10,0x0C,0x03,0x21,0x40,0x3F,0x00,0x00,0x03,0x1C ,0x08,0x00};code unsigned char Table5[]={/*-- 调入了一幅图像:C:\Documents and Settings\sammy\桌面\小新.bmp --*//*-- 宽度x高度=64x64 --*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF0 ,0xF8,0x7C,0x3C,0x1E,0x1E,0x8F,0xCF,0xCF,0xCF,0xDF,0x9F,0x9F,0x1F,0x1F,0x3F,0x3E ,0x3E,0x3E,0x7C,0x7C,0x7C,0xF8,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0x10,0x08,0x08,0x1E,0x3F,0x7F,0x03 ,0x00,0x00,0x00,0x06,0x07,0x07,0x03,0x03,0x03,0x0F,0x3F,0x3F,0x7E,0x78,0x78,0x30 ,0x00,0x00,0x00,0x00,0x60,0xE0,0xF0,0x78,0x39,0x39,0x73,0xFE,0x60,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x03,0x04,0x08,0x11,0x08,0x04,0x83,0x80,0x0C,0x92,0xA2,0x44 ,0x22,0x12,0x00,0x00,0x00,0x00,0x00,0x0F,0x30,0x40,0x80,0x80,0x80,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x02,0x02,0x04,0x04,0x04,0x08,0x08,0x08,0x08,0x10,0x10,0x00 ,0x00,0x00,0x00,0x40,0x40,0x80,0x80,0x80,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00 ,0x00,0x60,0x90,0x10,0x20,0x10,0x90,0x60,0x00,0x03,0x04,0x08,0x11,0x08,0x04,0x03 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x10 ,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x01,0x06,0xF8,0x00,0x00 ,0x00,0x00,0x00,0x01,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F ,0x7F,0xFF,0xF3,0xF3,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xF0,0xE0,0xE0,0xE0,0xE0 ,0xE0,0xE0,0xE4,0xE0,0xE0,0xE0,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x01,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xD8,0xD8,0xFC ,0xFC,0xFC,0xFD,0xFD,0xFF,0xF7,0xF7,0xF7,0xF7,0xFF,0xFF,0xFF,0xFF,0xF3,0xF7,0xF7 ,0xFF,0xFF,0xFF,0xFD,0xFD,0xFC,0xDC,0xD8,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0 ,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0 ,0xC0,0xC0,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,0x7F,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};code uchar Table8[]={/*-- 文字: 相 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0xD0,0xFF,0x30,0x50,0x90,0x00,0xFE,0x22,0x22,0x22,0x22,0xFE ,0x00,0x00,0x04,0x03,0x00,0xFF,0x00,0x00,0x01,0x00,0xFF,0x42,0x42,0x42,0x42,0xFF ,0x00,0x00,/*-- 文字: 约 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x40,0x60,0x58,0xC7,0x60,0x18,0x40,0x20,0x58,0x8F,0x08,0x08,0x08,0xF8 ,0x00,0x00,0x10,0x32,0x13,0x12,0x0A,0x0A,0x08,0x00,0x00,0x00,0x43,0x80,0x40,0x3F ,0x00,0x00,/*-- 文字: 丛 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0xFE,0x80,0x00,0x00,0x00 ,0x00,0x00,0x20,0x30,0x2C,0x23,0x20,0x21,0x36,0x2C,0x23,0x20,0x20,0x23,0x26,0x3C ,0x28,0x00,/*-- 文字: 林 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0x90,0xFF,0x90,0x10,0x00,0x10,0x10,0xD0,0xFF,0x90,0x10,0x10 ,0x10,0x00,0x08,0x06,0x01,0xFF,0x00,0x13,0x08,0x04,0x03,0x00,0xFF,0x01,0x06,0x18 ,0x08,0x00};code uchar Table9[]={/*-- 文字: 浪 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x30,0x01,0xC6,0x30,0x00,0xFC,0x94,0x95,0x96,0x94,0x94,0xFC,0x00 ,0x00,0x00,0x04,0x04,0xFE,0x01,0x00,0x00,0xFF,0x40,0x21,0x06,0x08,0x34,0x62,0xC2 ,0x40,0x00,/*-- 文字: 漫 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x20,0x81,0x66,0x00,0xC0,0x5F,0xD5,0x55,0x55,0xD5,0x55,0x5F,0xC0 ,0x00,0x00,0x04,0xFC,0x03,0x00,0x00,0x81,0x85,0x4D,0x55,0x25,0x35,0x4D,0xC5,0x41 ,0x00,0x00,/*-- 文字: 野 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x7E,0x4A,0xFE,0x4A,0x4A,0x7E,0x00,0x42,0x52,0xD2,0x6A,0x46,0xC2 ,0x40,0x00,0x22,0x22,0x22,0x1F,0x12,0x12,0x12,0x00,0x40,0x80,0x7F,0x00,0x00,0x00 ,0x00,0x00,/*-- 文字: 岭 --*//*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0xF0,0x00,0xFF,0x00,0xF0,0x40,0x20,0x10,0x2C,0x43,0x04,0x08,0x70 ,0x20,0x00,0x08,0x1F,0x08,0x07,0x04,0x07,0x01,0x05,0x09,0x11,0x29,0x65,0x03,0x01 ,0x00,0x00};void Delay_us(unsigned int DelayTime){while(DelayTime) DelayTime--;}void Delay_x10ms(unsigned char DelayTime) //***************10ms延时**********//{unsigned char i,j,k;for(i=0;i<DelayTime;i++)for(j=0;j<10;j++)for(k=0;k<120;k++) {;}}/*----------------------------------------------------------------------------下面这个函数用于液晶模块的忙信号检测。
12864中文字库C语言
12864中文字库C语言#include <reg52.h>#include <intrins.h>#define LcmXPixel 128 //横像素#define LcmYPixel 64 //纵像素//#define BUS_MODE //总线模式#define IO_MODE //IO模式//总线模式程序接口#ifdef BUS_MODEchar xdata LcmWCmdPort _at_ 0x0000; //写命令char xdata LcmWDatPort _at_ 0x0100; //写数据char xdata LcmRStaPort _at_ 0x0200; //读状态char xdata LcmRDatPort _at_ 0x0300; //读数据#endifvoid int_zhongduan();void delay(unsigned int t);//IO模式程序接口#ifdef IO_MODEsbit RSP = P2^0; //RSP表示RS Port,P=Port,下同sbit RWP = P2^1;sbit EP = P2^2; //E信号在本程序中是通过单片机的WR和RD与非出来的,是为了不改动总线模式的连线方式sbit RES =P2^3;#define LcmDataBus P0 //用户可以不用这样操作,直接用一个IO 口来操作,替换本程序中_E1_()和_E0_()两个函数#endifsbit Key=P3^2;sbit P33=P3^3;sbit p0_dr=P3^4; //坚鸿测试架增加指令,控制P0口的输入输出。
(用户不用理会这里)unsigned char code AC_TABLE[]={0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,};unsigned char code str1[]="黄河远上白云间,一片孤城万仞山。
51单片机带字库12864液晶动态汉字显示C语言源程序
51单片机带字库12864液晶动态汉字显示C语言源程序2009-10-17 19:36实验芯片为:AT89S52,带字库液晶屏:12864,实现的目的:动态一个汉字一个汉字显示。
其实和显示汉字的程序一样,只是稍做一下修改即可。
C语言源程序如下:#include <stdio.h>#include <math.h>#include <reg52.h>#include <string.h>sbit RS=P2^4;sbit WRD=P2^5;sbit E=P2^6;sbit PSB=P2^1;sbit RES=P2^3;void TransferData(char data1,bit DI);void delayms(unsigned int n);void delay(unsigned int m);void lcd_mesg003(unsigned char code *addr1);unsigned char code IC_DAT[]={"我是一个中国人啊"};void initinal(void){delay(40);PSB=1; //并口工作模式delay(1);RES=0; //复位delay(1);RES=1; //复位置高delay(10);TransferData(0x30,0);delay(100);TransferData(0x30,0);delay(37);TransferData(0x08,0);delay(100);TransferData(0x10,0);delay(100);TransferData(0x0C,0);delay(100);TransferData(0x01,0);delay(10);TransferData(0x06,0);delay(100);}void main(void){while(1){initinal();//调用LCD字库初始化程序delay(100);lcd_mesg003(IC_DAT);}}void lcd_mesg003(unsigned char code *addr1){unsigned char i;//第一行TransferData(0x80,0);delay(100);for(i=0;i<16;i++){TransferData(*addr1,1);addr1++;delayms(50);}}void TransferData(char data1,bit DI) //传送数据或是命令,当DI=0时,传送命令,当DI=1时,传送数据{WRD=0;RS=DI;delay(1);P0=data1;E=1;delay(1);E=0;}void delayms(unsigned int n){unsigned int i,j;for(i=0;i<n;i++)for(j=0;j<2000;j++);}void delay(unsigned int m){unsigned int i,j;for(i=0;i<m;i++)for(j=0;j<10;j++);}原理就是在显示每个汉字的时候加了一个延时程序,当然可以用定时器来实现,这样的话,不占用CPU处理时间。
lcd12864c语言编程详解
12864系列点阵型液晶显示模块使用说明书一、OCM12864液晶显示模块概述1.OCM12864液晶显示模块是128×64点阵型液晶显示模块,可显示各种字符及图形,可与CPU直接接口,具有8位标准数据总线、6条控制线及电源线。
采用KS0107控制IC。
2.外观尺寸:113×65×11mm(ocm12864-1), 93×70×10mm(ocm12864-2)78×70×10mm(ocm12864-3),3.视域尺寸:73.4×38.8mm(ocm12864-1) 70.7×38mm(ocm12864-2),64×44mm(ocm12864-3)4.重量:大约g补充说明:外观尺寸可根据用户的要求进行适度调整。
二、最大工作范围1、逻辑工作电压(Vcc):4.5~5.5V2、电源地(GND):0V3、LCD驱动电压(Vee):0~-10V4、输入电压:Vee~Vdd5、工作温度(Ta):0~55℃(常温) / -20~70℃(宽温)6、保存温度(Tstg):-10~65℃三、电气特性(测试条件 Ta=25,Vdd=5.0+/-0.25V)1、输入高电平(Vih):3.5Vmin2、输入低电平(Vil):0.55Vmax3、输出高电平(Voh):3.75Vmin4、输出低电平(Vol):1.0Vmax5、工作电流:2.0mAmax四、接口说明12864-3A接口说明表五、指令描述1、显示开/关设置CODE:R/W D/I DB7 DB6 DB5 DB4 DB3 DB2DB1 DB0功能:设置屏幕显示开/关。
DB0=H,开显示;DB0=L,关显示。
不影响显示RAM(DD RAM)中的内容。
2、设置显示起始行CODE:R/W D/I DB7 DB6 DB5 DB4 DB3 DB2DB1 DB0功能:执行该命令后,所设置的行将显示在屏幕的第一行。
12864C语言程序
#include<reg51.h>//#include<table.h>#define uchar unsigned char#define uint unsigned int#define lcddata P0#define busy 0x80uchar code table_1[]="你始终是宇宙中的"; uchar code table_2[]="第一高手!!!!"; uchar code table_3[]="....恭喜恭喜...."; uchar code table_4[]="....00:00:00...."; uchar tc,ad,tf;sbit rs=P2^6;sbit rw=P2^7;sbit en=P2^4;sbit res=P2^5;void write_dat(uchar dat);void write_comm(uchar comm);void init();void biao();void display(uchar line);void delay(uint);void main(){TMOD=0x01;TH0=(65536-50000)/256;TL0=(65536-50000)%256;EA=1;ET0=1;TR0=1;init();display(1);display(2);display(3);display(4);while(1){biao();}}void write_dat(uchar dat){delay(100);rs=1;rw=0;en=1;lcddata=dat;en=0;}void write_comm(uchar comm){rs=0;rw=0;en=1;lcddata=comm;en=0;}void init(){rs=0;rw=0;res=1;res=0;res=1;write_comm(0x30);//基本指令动作delay(5);write_comm(0x0e);//开显示及光标delay(5);}void display(uchar line){uchar i;if(line==1)ad=0x80;else if(line==2)ad=0x90;else if(line==3)ad=0x88;else if(line==4)ad=0x98;write_comm(ad);for(i=0;i<16;i++){if(line==1)write_dat(table_1[i]);if(line==2)write_dat(table_2[i]);if(line==3)write_dat(table_3[i]);if(line==4)write_dat(table_4[i]);}}void delay(uint z){uint x,y;for(x=z;x>0;x--)for(y=110;y>0;y--);}void timer0() interrupt 1{TH0=(65536-50000)/256;TL0=(65536-50000)%256;if(tc>=20){tc=0;tf=1;}}void biao(){for(flag){if(table_4[11]=='9'){table_4[11]='0';table_4[10]++;if(table_4[10]=='6'){table_4[10]=='0';table_4[8]++;if(table_4[8]=='9'){table_4[8]='0';table_4[7]++;if(table_4[7]=='6'){table_4[7]='0';table_4[5]++;if(table_4[5]=='9'){table_4[5]='0';table_4[4]++;if((table_4[5]==4)&&(table_4[4]==2))table_4[5]='0';table_4[4]='0';}}}}}write_comm(0x98);display(4);}}。
LCD12864显示程序
L C D12864显示程序(总3页) -CAL-FENGHAI.-(YICAI)-Company One1-CAL-本页仅作为文档封面,使用请直接删除本例程为通过用AT89C52芯片操作LCD12864显示的程序,使用的晶振为12M。
/**********************************************************程序说明:LCD12864显示主程序程序调试员:莫剑辉调试时间:2010-6-7**********************************************************/#include<reg52.h>#include"12864.c"void main(){Ini_Lcd(); //液晶初始化子程序Disp(1,0,6,"莫剑辉"); //显示数据到LCD12864子程序while(1);}这里我们通过调用下面的头文件就可以了,这样的做法方便我们以后要用到LCD12864的程序的调用。
/**********************************************************程序说明:LCD12864显示头文件程序调试员:莫剑辉调试时间:2010-6-7**********************************************************///#include<reg52.h>#define uchar unsigned char#define uint unsigned int#define DATA P2 //数据输出端0~7sbit RS=P0^0; //LCD12864 RS端sbit RW=P0^1; //LCD12864 RW端sbit E =P0^2; //LCD12864 E 端sbit PSB =P0^3;/*********************************************延时子程序*********************************************/void Delay_1ms(uint x){uint j,i;for(j=0;j<x;j++){for(i=0;i<120;i++); //延时X乘以120}}/*********************************************LCD12864液晶测忙子程序(读状态)*********************************************/void Busy(){uchar busy;do{E = 0; //0为关闭使能端,1为打开使能端RS = 0; //1为指令,0为数据RW = 1; //1为读,0为写Delay_1ms(20); //延时20乘以120时间E = 1; //0为关闭使能端,1为打开使能端busy=P1; //读取P2状态Delay_1ms(20); //延时20乘以120时间E = 0; //0为关闭使能端,1为打开使能端}while(busy&0x80); //判断BUSY位是否工作:1为内部在工作,0为正常状态}/*********************************************LCD12864液晶数据写入子程序*********************************************/void Write_Data(uchar k){Busy(); //测忙E =1; //0为关闭使能端,1为打开使能端RS=1; //1为指令,0为数据RW=0; //1为读,0为写DATA=k; //输入数据K到DATADelay_1ms(20); //延时20乘以120时间E =0; //0为关闭使能端,1为打开使能端Delay_1ms(20); //延时20乘以120时间}/*********************************************LCD12864液晶命令写入子程序*********************************************/void Write_Cmd(uchar cmd){Busy(); //测忙E=1; //0为关闭使能端,1为打开使能端RS=0; //1为指令,0为数据RW=0; //1为读,0为写DATA=cmd; //输入命令cmd到DATADelay_1ms(20); //延时20乘以120时间E=0; //0为关闭使能端,1为打开使能端Delay_1ms(20); //延时20乘以120时间}/*********************************************LCD12864液晶数据显示子程序*********************************************/void Disp(uchar y,uchar x,uchar i,uchar *z){uchar Address;if(y==1){Address=0x80+x;} //Y判断第几行,X判断第几列,0x80为液晶行初始地址if(y==2){Address=0x90+x;}if(y==3){Address=0x88+x;}if(y==4){Address=0x98+x;}Write_Cmd(Address); //写入地址命令到LCD12864while(i) //写入显示数据的大小{Write_Data(*(z++)); //写入显示数据到LCD12864i--;}}/*********************************************LCD12864液晶初始化子程序*********************************************/void Ini_Lcd(void){PSB=1;Delay_1ms(20);Write_Cmd(0x30); //基本指令集Delay_1ms(20);Write_Cmd(0x02); // 地址归位Delay_1ms(20);Write_Cmd(0x0c); //整体显示打开,游标关闭Delay_1ms(20);Write_Cmd(0x06); //游标右移Delay_1ms(20);Write_Cmd(0x80); //设定显示的起始地址Delay_1ms(20);Write_Cmd(0x01); //清除显示}。
12864C-1中文字库说明书(注意驱动电压是3.3V)
*注释 1:如在实际应用中仅使用并口通讯模式,可将 PSB 接固定高电平,也可以将模块上的 J8 和“VCC”用焊锡短接。
*注释 2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。
*注释 3:如背光和模块共用一个电源,可以将模块上的 JA、JK 用焊锡短接。
四.模块主要硬件构成说明
将以上 16 位地址连续写入即可
备注;当 IC1 在接受指令前,微处理器必须先确认其内部处于非忙碌状态,即读取 BF 标志时,BF 需为零,方可接受新的指 令;如果在送出一个指令前并不检查 BF 标志,那么在前一个指令和这个指令中间必须延长一段较长的时间,即是等待前 一个指令确实执行完成。
六、读写时序图
反白 选择
0
0
选择 2 行中的任一行作反白显示,并可 0 0 0 0 0 1 R1 R0 决定反白与否。初始值 R1R0=00,第一
次设定为反白显示,再次设定变回正常
睡眠 模式
0
0
0
0
0
0
1 SL X
X
SL=0:进入睡眠模式 SL=1:脱离睡眠模式
扩充 功能 0 设定
0
CL=0/1:4/8 位数据
0
执行动作 I/O 缓冲——>DR DR——>I/O 缓冲 无动作
结果 配合/W 进行写数据或指令 配合 R 进行读数据或指令
● 忙标志:BF BF 标志提供内部工作情况.BF=1 表示模块在进行内部操作,此时模块不接受外部指令和数据.BF=0 时,模块为准备
状态,随时可接受外部指令和数据. 利用 STATUS RD 指令,可以将 BF 读到 DB7 总线,从而检验模块之工作状态.
八、软件初始化
12864图片显示c程序
#include<reg52.h>#include<intrins.h>#define uint unsigned int#define uchar unsigned charsbit PSB=P3^7;sbit RW=P3^5;sbit RS=P3^4;sbit EN=P3^6;//sbit beef=P2^5;uchar code table[]="祝大家学习快乐!";uchar lcd_x,lcd_y;uchar code image[]={0x02,0x08,0x00,0x08,0x00,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00, 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, 0x40,0x03,0x85,0x4B,0x4A,0x10,0x20,0x12,0x30,0x00,0x80,0x40,0x00,0x00,0x00,0x00,0x50,0x7C,0x62,0x11,0x5B,0xF0,0xE0,0x13,0x8F,0xC0,0x80,0x20,0x00,0x00,0x00,0x00, 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x78,0x3F,0x00,0x20,0x00,0x00,0x00,0x00, 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x03,0xC0,0x80,0x20,0x00,0x00,0x00,0x00, 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x0F,0x80,0x20,0x00,0x00,0x00,0x00, 0x84,0x80,0x00,0x1C,0x08,0x0E,0x04,0x28,0x00,0x00,0x40,0x20,0x00,0x00,0x00,0x00, 0x04,0x1C,0x08,0x22,0x00,0x11,0x00,0x18,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x00, 0x02,0x22,0x00,0x21,0x00,0x10,0x80,0x08,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x00,0xA1,0xA1,0x00,0x24,0xE0,0x12,0x70,0x10,0x00,0x00,0x30,0x20,0x00,0x00,0x00,0x00, 0x80,0x24,0xE0,0x18,0x10,0x0C,0x08,0x10,0x00,0x00,0x28,0x20,0x00,0x00,0x00,0x00, 0x98,0x18,0x10,0x00,0x80,0x80,0x40,0x10,0x08,0x00,0x25,0xE0,0x00,0x00,0x00,0x00, 0x24,0x00,0x81,0x00,0x00,0x80,0x00,0x1A,0x08,0x00,0x22,0x20,0x00,0x00,0x00,0x00,0xC1,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0x46,0x00,0x22,0xA0,0x00,0x00,0x00,0x00, 0x08,0x00,0x00,0x01,0x04,0x00,0x82,0x0F,0x93,0x40,0x21,0x40,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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(uint x){x=x*12;while(x--){_nop_();_nop_();_nop_();}}void write_lcd_cmd(uchar cmd)//写命令{RS=0;RW=0;EN=1;P0=cmd;// delay(1);EN=0;delay(1);}void write_lcd_date(uchar date)//写数据{RS=1;RW=0;EN=1;P0=date;// delay(1);EN=0;delay(1);}void display_pos(uchar x,uchar y)//设置显示地址{uchar pos;switch(x){case 0: pos=0x80; break;case 1: pos=0x90; break;case 2: pos=0x88; break;case 3: pos=0x98; break;default: pos=0x80;}pos=pos+y;write_lcd_cmd(pos);}/*==================================================== 函数功能:清除GCROM的内容,如果不清除会出现花屏现象清除方法:向GCROM中写入0x00来清除内容========================================================*/void clear_gcrom(){uchar i,j,k;lcd_x=0x80;lcd_y=0x80;write_lcd_cmd(0x34);for(i=0;i<2;i++){for(j=0;j<32;j++){write_lcd_cmd(lcd_y+j);write_lcd_cmd(lcd_x);for(k=0;k<16;k++){write_lcd_date(0x00);}}lcd_x=0x88;}write_lcd_cmd(0x36);write_lcd_cmd(0x30);}/*================================================================ 函数功能:向12864中写入一幅图片函数参数:lcd_x为水平显示位置,lcd_y为垂直显示位置,函数将12864屏分成上下两屏写入,上半屏LCD_x=0x80,下半屏lcd_x=0x88=================================================================*/ void write_image(uchar *p){uchar i,j,k;lcd_x=0x80;lcd_y=0x80;write_lcd_cmd(0x34);for(i=0;i<2;i++) //分为上下两屏{for(j=0;j<32;j++){write_lcd_cmd(lcd_y+j);write_lcd_cmd(lcd_x);for(k=0;k<16;k++) //写入显示数据{write_lcd_date(*p++);}}lcd_x=0x88;}write_lcd_cmd(0x36);write_lcd_cmd(0x30);}void init()//初始化函数{// beef=0;RW=0;write_lcd_cmd(0x30);//基本指令动作write_lcd_cmd(0x0c);write_lcd_cmd(0x06);write_lcd_cmd(0x01);//清除显示delay(5);}void main(){uint i;init();// write_lcd_cmd(0x1c);clear_gcrom();write_image(image);display_pos(3,0);for(i=0;i<17;i++)write_lcd_date(table[i]);while(1);}。
12864-液晶显示-c语言程序
TransferData(0x36,0); //Extended Function Set:RE=1: extended instruction set
delay(37); ////大于37uS的延时程序
TransferData(0x3E,0); //EXFUNCTION(DL=8BITS,RE=1,G=1)
uchar code IC_DAT[]={
" HOT-51 "
" "
"单片机开发板"
"东流电子"
};
uchar code IC_DAT2[]={
"白日依山尽,"//0x80
"欲穷千里目,"//0x90
"黄河入海流。"//0x88
"更上一层楼。"//0x98
};
/********************************************************************
delay(37); ////大于37uS的延时程序
TransferData(0x08,0); //Display on Control
delay(100); //大于100uS的延时程序
TransferData(0x10,0); //Cursor Display Control光标设置
delay(100); //大于100uS的延时程序
void display_grapic(void);
void delayms(uint n);
void DisplayLine(uchar line1,uchar line2);
LCD12864写字符串程序及其头文件
delay(2);
write_data(0xC5);//八根线并行传输的原因,为此需要每八个字节进行传输
delay(2);
write_data(0xD4);
delay(2);
write_data(0xF6);
delay(2);
write_data(0xB9);
delay(3);
write_com(0x0C); //显示开/关光标
delay(5);
write_com(0x01); //清除LCD的显示,即清屏指令
delay(5);
}
/********************************************
光标定位函数,X显示列,Y显示行
***********************************************/
#include<macros.h>
#define uchar unsigned char
#define uint unsigned int
#define RS_0 PORTC&=~(1<<PC0) //数据指令选择端高电平数据低电平指令
#define RS_1 PORTC|=(1<<PC0)
#define RW_0 PORTC&=~(1<<PC1) //并口时,读写选择端,低电平写;串口时数据输入端
void LCD_init()
{
write_com(0x01);
delay(5) ; //清屏指令
PSB_1; //并口数据传输模式
RST_0; //低电平复位
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#include <avr/io.h>#include <util/delay.h>#define uchar unsigned char#define uint unsigned int#define LCD_data PORTAsbit LCD_RS =P2^5;//数据命令选择端:H为数据;L为命令sbit LCD_RW =P2^6;//读写选择端:H为读;L为写sbit LCD_EN =P2^7;//使能信号端:高脉冲完成操作sbit LCD_PSB =P2^4;//串并选择端:H为并行;L为串行sbit LCD_RST =P2^2; //复位,低电平有效sbit qq=P3^2;unsigned char code pic2[];uchar code dis1[]={"0123456789 "};uchar code IC_DA T2[]={" 白日依山尽,"//0x80" 黄河入海流。
"//0x90欲穷千里目," 欲穷千里目,"//0x88" 更上一层楼。
"//0x98};/********************************延时误差:每秒0.005秒*********************************/void delayms(uint z){uint i,j;for(i=z;i>0;i--)for(j=113;j>0;j--);}void delay(unsigned int m) //延时程序{unsigned int i,j;for(i=0;i<m;i++)for(j=0;j<10;j++);}/*******************************12864写命令函数RS=L、RW=L,EN高脉冲D0-D7指令码******************************/void L12864_writecmd(uchar cmd){LCD_RS=0;LCD_RW=0;LCD_EN=0;LCD_data=cmd;delayms(5);LCD_EN=1;delayms(5);LCD_EN=0;}/********************************12864初始化函数********************************/void L12864_init_1(){LCD_PSB=1;LCD_RST=0;delay(1);LCD_RST=1;L12864_writecmd(0x30);// 功能设定:基本功能,关图片显示L12864_writecmd(0x0c);//开显示,开游标L12864_writecmd(0x01);//清屏显示}/********************************************************************* 名称: 12864初始化函数***********************************************************************/void L12864_initi_2(void) //LCD显示图片(扩展)初始化程序{//delay(40); //大于40MS的延时程序LCD_PSB=1; //设置为8BIT并口工作模式delay(1); //延时LCD_RST=0; //复位delay(1); //延时LCD_RST=1; //复位置高delay(10);L12864_writecmd(0x36); //Extended Function Set RE=1: extended instruction//delay(100); //大于100uS的延时程序//L12864_writecmd(0x36,0); //Extended Function Set:RE=1: extended instruction set//L12864_writecmd(37); ////大于37uS的延时程序L12864_writecmd(0x3E); //EXFUNCTION(DL=8BITS,RE=1,G=1)//delay(100); //大于100uS的延时程序L12864_writecmd(0x01); //CLEAR SCREEN//delay(100); //大于100uS的延时程序}/***************************12864写数据函数RS=H、RW=L、EN高脉冲D0-D7数据信息**************************/void L12864_writedat(uchar dat){LCD_RS=1;LCD_RW=0;LCD_EN=0;LCD_data=dat;delayms(5);LCD_EN=1;delayms(5);LCD_EN=0;}/***********************12864设定初始显示位置***********************/void L12864_focuspos(uchar X,uchar Y){uchar pos;if(X==0){X=0x80;}else if(X==1){X=0x90;}else if(X==2){X=0x88;}else if(X==3){X=0x98;}pos=X+Y-1;L12864_writecmd(pos);}void L12864_displayline(uchar hang1, uchar hang2, uchar code *adder1) { uchar X,Y,i;X=hang1;Y=hang2;if(X==1) X=0x80;else if(X==2) X=0x90;else if(X==3) X=0x88;else if(X==4) X=0x98;L12864_writecmd(X);if(Y==1){for(i=0;i<16;i++){L12864_writedat(*adder1);adder1++;}}if(Y==2){for(i=0;i<16;i++)adder1++;for(i=16;i<32;i++){L12864_writedat(*adder1);adder1++;}}if(Y==3){for(i=0;i<32;i++)adder1++;for(i=32;i<48;i++){L12864_writedat(*adder1);adder1++;}}if(Y==4){for(i=0;i<48;i++)adder1++;for(i=48;i<64;i++){L12864_writedat(*adder1);adder1++;}}}void L12864_displaypage( uchar code *adder1){unsigned char i;L12864_writecmd(0x80);delay(100);for(i=0;i<32;i++){L12864_writedat(*adder1);adder1++;}L12864_writecmd(0x90);delay(100);for(i=32;i<64;i++){L12864_writedat(*adder1);adder1++;}}void L12864_displaypicture( uchar code *adder){int a,b;//*******显示上半屏内容设置for(a=0;a<32;a++) //{L12864_writecmd((0x80 + a)); //SET 垂直地址VERTICAL ADDL12864_writecmd(0x80); //SET 水平地址HORIZONTAL ADD for(b=0;b<16;b++){L12864_writedat(*adder);adder++;}}//*******显示下半屏内容设置for(a=0;a<32;a++) //{L12864_writecmd((0x80 + a)); //SET 垂直地址VERTICAL ADDL12864_writecmd(0x88); //SET 水平地址HORIZONTAL ADDfor(b=0;b<16;b++){L12864_writedat(*adder);adder++;}}}void main(){while(1){L12864_writecmd(0x01);delay(10);L12864_writecmd(0x30);delay(10);L12864_displayline(2,3,IC_DA T2);delayms(500);L12864_writecmd(0x01);L12864_writecmd(0x36);//L12864_displaypicture(pic2);//delayms(500);}}unsigned char code pic2[]={ /*-- 调入了一幅图像:C:\Users\Administrator\Desktop\889.bmp --*//*-- 宽度x高度=128x64 --*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xDE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x7F,0xF0,0x01,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0F,0xFF,0xFF,0x81,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0xFF,0xF1,0xFF,0xC1,0xCF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x03,0xFF,0xE0,0x3F,0xF9,0xCF,0x00,0x00,0x3F,0x80,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0xFC,0x00,0x01,0xFF,0xC7,0x00,0x07,0xFF,0xC0,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0xE0,0x00,0x00,0x3F,0xFF,0x80,0x3F,0xFF,0xE0,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0xE0,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xC0,0xF0,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xE0,0x00,0x00,0x01,0xFF,0xFF,0xFF,0x00,0xF0,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xF0,0x00,0x00,0x01,0xC7,0xFF,0xF0,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xF0,0x00,0x00,0x01,0xC7,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x01,0xC7,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x01,0xC7,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x01,0xC7,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x01,0xC3,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x01,0xC3,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x01,0xC3,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x01,0xC3,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x03,0xC3,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x03,0xC3,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x03,0x83,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x70,0x00,0x00,0x03,0x83,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x03,0x83,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x03,0x83,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x07,0x83,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x07,0x03,0x80,0x00,0x00,0x70,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x07,0x03,0x80,0x00,0x00,0x78,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x07,0x03,0x80,0x00,0x00,0x38,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x00,0x00,0x07,0x03,0x80,0x00,0x00,0x38,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x3C,0x00,0x00,0x07,0x03,0x80,0x00,0x00,0x38,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x3F,0xFF,0x80,0x07,0x03,0x80,0x00,0x00,0x38,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x1F,0xFF,0xFF,0x07,0x03,0xFF,0xFF,0x00,0x38,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x3C,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDC,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x80,0x00,0xFF,0xF8,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x03,0x80,0x00,0x07,0xF8,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x07,0x80,0x00,0x00,0x38,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x1F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x0F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x07,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x07,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};。