#include <reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit 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,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},