#include unsigned char code zm[][32] = { /*-- 文字: 广 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x00,0xFC,0x04,0x04,0x04,0x04,0x05,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x00, 0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*-- 文字: 州 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0xE0,0x00,0x00,0xFF,0x20,0xC0,0x00,0xFE,0x10,0x60,0x80,0x00,0xFF,0x00,0x00, 0x01,0x80,0x60,0x18,0x07,0x00,0x00,0x00,0x7F,0x00,0x00,0x01,0x00,0xFF,0x00,0x00}, /*-- 文字: 致 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x22,0x32,0x2E,0xE2,0x2A,0x72,0x22,0x30,0xDF,0x12,0x10,0xF0,0x10,0x10,0x00, 0x00,0x21,0x21,0x21,0x3F,0x11,0x91,0x51,0x20,0x13,0x0C,0x12,0x21,0xC0,0x40,0x00}, /*-- 文字: 远 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x40,0x42,0x4C,0xC4,0x20,0x22,0x22,0xE2,0x22,0x22,0xE2,0x22,0x22,0x20,0x20,0x00, 0x00,0x40,0x20,0x1F,0x20,0x48,0x44,0x43,0x40,0x40,0x47,0x48,0x48,0x48,0x4E,0x00}, /*-- 文字: 电 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x00,0xF8,0x48,0x48,0x48,0x48,0xFF,0x48,0x48,0x48,0x48,0xF8,0x00,0x00,0x00, 0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x3F,0x44,0x44,0x44,0x44,0x4F,0x40,0x70,0x00}, /*-- 文字: 子 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x00,0x02,0x02,0x02,0x02,0x02,0xE2,0x12,0x0A,0x06,0x02,0x00,0x80,0x00,0x00, 0x01,0x01,0x01,0x01,0x01,0x41,0x81,0x7F,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00}, /*-- 文字: 有 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x04,0x84,0x44,0xE4,0x34,0x2C,0x27,0x24,0x24,0x24,0xE4,0x04,0x04,0x04,0x00, 0x02,0x01,0x00,0x00,0xFF,0x09,0x09,0x09,0x29,0x49,0xC9,0x7F,0x00,0x00,0x00,0x00}, /*-- 文字: 限 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0xFE,0x02,0x32,0x4E,0x82,0x00,0xFE,0x4A,0xCA,0x4A,0x4A,0x4A,0x7E,0x00,0x00,0x00, 0xFF,0x00,0x02,0x04,0x03,0x00,0xFF,0x40,0x20,0x03,0x0C,0x12,0x21,0x60,0x20,0x00}, /*-- 文字: 公 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x00,0x80,0x40,0x30,0x0E,0x84,0x00,0x00,0x0E,0x10,0x60,0xC0,0x80,0x80,0x00, 0x00,0x01,0x20,0x70,0x28,0x24,0x23,0x31,0x10,0x10,0x14,0x78,0x30,0x01,0x00,0x00}, /*-- 文字: 司 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x10,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x92,0x12,0x02,0x02,0xFE,0x00,0x00, 0x00,0x00,0x1F,0x04,0x04,0x04,0x04,0x04,0x04,0x0F,0x00,0x20,0x40,0x3F,0x00,0x00}, /*-- 文字: : --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /*-- 文字: 软 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x88,0xC8,0xB8,0x8F,0xE8,0x88,0x88,0x20,0x1C,0x0B,0xE8,0x08,0x08,0x18,0x08,0x00, 0x08,0x08,0x08,0x08,0xFF,0x04,0x84,0x60,0x18,0x06,0x01,0x06,0x18,0xE0,0x40,0x00}, /*-- 文字: 件 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x40,0x20,0xF8,0x0F,0x82,0x60,0x1E,0x14,0x10,0xFF,0x10,0x10,0x10,0x10,0x00,0x00, 0x00,0x00,0xFF,0x00,0x01,0x01,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x00}, /*-- 文字: 事 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x02,0x02,0x82,0xBA,0xAA,0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xAA,0xBA,0x02,0x02,0x00, 0x02,0x02,0x0A,0x0A,0x2A,0x4A,0x8A,0x7F,0x0A,0x0A,0x0A,0x0A,0x1F,0x02,0x02,0x00}, /*-- 文字: 业 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x00,0x10,0x60,0x80,0x00,0xFF,0x00,0x00,0x00,0xFF,0x00,0x80,0x60,0x38,0x10,0x00, 0x20,0x20,0x20,0x23,0x21,0x3F,0x20,0x20,0x20,0x3F,0x22,0x21,0x20,0x30,0x20,0x00}, /*-- 文字: 部 --*/ /*-- 宋体12; 此字体下对应的点阵为:宽x高=16x16 --*/ {0x40,0x44,0x4C,0x75,0x46,0x64,0x5C,0x44,0x40,0xFE,0x02,0x42,0x62,0x9A,0x06,0x00, 0x00,0x00,0x7E,0x22,0x22,0x22,0x22,0x7E,0x00,0xFF,0x00,0x08,0x08,0x10,0x0F,0x00}, }; #define CS_A 1 #define CS_B 2 sbit Lcd_E = P1^0; sbit Lcd_RW = P1^1; sbit Lcd_DI = P1^2; sbit Lcd_CSA = P1^3; sbit Lcd_CSB = P1^4; void dely(char dly) { int i; while (dly--) { for (i=0;i<5000;i++); } } unsigned char readdata(void) { Lcd_DI = 1; Lcd_RW = 1; Lcd_E = 0; Lcd_E = 1; return P0; } void writedat(char cs,unsigned char dat) { if (cs&CS_A) Lcd_CSA = 1; if (cs&CS_B) Lcd_CSB = 1; Lcd_DI = 1; Lcd_RW = 0; P0 = dat; Lcd_E = 1; Lcd_E = 0; Lcd_CSA = 0; Lcd_CSB = 0; } void writecom(char cs,unsigned char dat) { if (cs&CS_A) Lcd_CSA = 1; if (cs&CS_B) Lcd_CSB = 1; Lcd_DI = 0; Lcd_RW = 0; P0 = dat; Lcd_E = 1; Lcd_E = 0; Lcd_CSA = 0; Lcd_CSB = 0; } void LcdClr(char dat){ register char page; register char col; for (page=0x00;page<0x8;page++) //LCD_L { writecom(CS_A|CS_B,0x0b8+page); //Lcd_X Address writecom(CS_A|CS_B,0x40); //Lcd_Y Address for (col=0x00;col<0x40;col++) { writedat(CS_A|CS_B,dat); } } } void disp(char x,char y,unsigned char code * dat) { int i; char CS; if (x>=64) { CS = CS_B; x = x-64; } else { CS = CS_A; } writecom(CS,0xb8 + y); writecom(CS,0x40+x); for (i=0;i<16;i++) { writedat(CS,*dat++); } writecom(CS,0xb9 + y); writecom(CS,0x40+x); for (i=0;i<16;i++) { writedat(CS,*dat++); } } main() { unsigned char i,j,k; // for (i=0;i<10;i++); i =0; P1 = 0; writecom(CS_A|CS_B,0x3f); while (1) { k = 0; LcdClr(0x00); for(j=0;j<4;j+=2) for (i=0;i<128;i+=16) { disp(i,j,zm[k++]); dely(3); } dely(5); } }