本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
51单片机直接驱动KS0108 12864液晶的测试程序,已经调试过,绝对能用。
-
- #include <at89x51.h>
- #include <intrins.h>
- #include <stdio.h>
- //#include <main.h>
- sbit p_di=P1^5;
- sbit p_rw=P1^6;
- sbit p_e=P1^7;
- sbit p_cs1=P3^5;//L选通,即低电平有效
- sbit p_cs2=P3^4;//L选通,即低电平有效
- #define Data P0
- //******绝********//
- unsigned char code aa[2][16]={
- 0x00,0x40,0x70,0xCE,0x30,0x40,0xF0,0x4F,0xE8,0x38,0x28,0xE0,0x00,0x00,0x00,0x00,
- 0x00,0x12,0x13,0x0A,0x09,0x00,0x1F,0x22,0x21,0x21,0x21,0x21,0x38,0x00,0x00,0x00
- };
- //******妙********//
- unsigned char code bb[2][16]={
- 0x00,0x20,0xE0,0x1F,0x10,0xF0,0x80,0x70,0x00,0xFF,0x00,0xC8,0x10,0x60,0x00,0x00,
- 0x20,0x10,0x0B,0x04,0x2B,0x20,0x10,0x10,0x08,0x05,0x03,0x00,0x00,0x00,0x00,0x00
- };
- ///******科*******///
- unsigned char code cc[2][16]={
- 0x00,0x24,0xA4,0xFC,0x52,0x92,0x00,0x24,0x48,0x00,0xFF,0x80,0x80,0x00,0x00,0x00,
- 0x02,0x01,0x00,0x3F,0x00,0x00,0x01,0x01,0x01,0x01,0x3F,0x00,0x00,0x00,0x00,0x00
- };
- //******技****///
- unsigned char code dd[2][16]={
- 0x00,0x20,0x20,0xFF,0x90,0x10,0x90,0x90,0x7F,0x48,0xC8,0x08,0x00,0x00,0x00,0x00,
- 0x02,0x0A,0x11,0x3F,0x00,0x20,0x10,0x0A,0x04,0x0B,0x10,0x20,0x20,0x20,0x00,0x00
- };
- //******南
- unsigned char code ee[2][16]={
- 0x00,0x08,0xC8,0x48,0x48,0xC8,0x3F,0xE4,0xA4,0xA4,0x24,0xE4,0x04,0x00,0x00,0x00,
- 0x00,0x00,0x3F,0x00,0x05,0x05,0x3F,0x02,0x02,0x12,0x20,0x1F,0x00,0x00,0x00,0x00
- };
- //******京
- unsigned char code ff[2][16]={
- 0x00,0x08,0x08,0x08,0xE8,0xA8,0xA9,0x96,0x54,0x74,0x04,0x04,0x04,0x00,0x00,0x00,
- 0x00,0x10,0x08,0x04,0x02,0x08,0x10,0x3F,0x00,0x02,0x02,0x04,0x0C,0x00,0x00,0x00
- };
- //******发
- unsigned char code gg[2][16]={
- 0x00,0x00,0x30,0x2E,0x20,0xE0,0x9F,0x90,0x50,0xD2,0x14,0x10,0x10,0x00,0x00,0x00,
- 0x20,0x10,0x28,0x24,0x13,0x10,0x0A,0x04,0x0B,0x10,0x10,0x20,0x20,0x20,0x00,0x00
- };
- //******展
- unsigned char code hh[2][16]={
- 0x00,0x00,0x00,0xFE,0x0A,0x4A,0xFA,0x4A,0xF9,0xA5,0xA7,0x80,0x00,0x00,0x00,0x00,
- 0x20,0x18,0x06,0x01,0x01,0x3F,0x11,0x03,0x04,0x0C,0x12,0x20,0x20,0x00,0x00,0x00
- };
- //******有
- unsigned char code ii[2][16]={
- 0x00,0x08,0x88,0x48,0xE8,0x38,0x2C,0xAB,0xA8,0x24,0xE4,0x04,0x04,0x00,0x00,0x00,
- 0x02,0x01,0x00,0x00,0x3F,0x05,0x05,0x02,0x02,0x10,0x3F,0x00,0x00,0x00,0x00,0x00
- };
- //******限
- unsigned char code jj[2][16]={
- 0x00,0x00,0xFC,0x92,0xEE,0x00,0xFC,0x54,0xCA,0x2A,0x3E,0x80,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x3F,0x00,0x01,0x00,0x1F,0x10,0x08,0x03,0x05,0x08,0x10,0x10,0x00,0x00
- };
- //******公
- unsigned char code kk[2][16]={
- 0x00,0x00,0x80,0x60,0x1C,0x00,0xC0,0x01,0x06,0x18,0x60,0x80,0x00,0x00,0x00,0x00,
- 0x02,0x01,0x00,0x10,0x1C,0x13,0x10,0x08,0x0A,0x0C,0x18,0x01,0x01,0x01,0x00,0x00
- };
- //******司
- unsigned char code ll[2][16]={
- 0x00,0x00,0x10,0x94,0x94,0x54,0x4A,0xCA,0x0A,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x07,0x04,0x02,0x02,0x03,0x00,0x10,0x20,0x1F,0x00,0x00,0x00,0x00
- };
- //******专
- unsigned char code mm[2][16]={
- 0x00,0x40,0x40,0x48,0x48,0xC8,0x3F,0x24,0x24,0x24,0x24,0x20,0x20,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x03,0x0A,0x0A,0x11,0x19,0x25,0x03,0x00,0x00,0x00,0x00,0x00
- };
- //******业
- unsigned char code nn[2][16]={
- 0x00,0x00,0x60,0x80,0x00,0xFE,0x00,0x00,0xFE,0x00,0xC0,0x30,0x00,0x00,0x00,0x00,
- 0x00,0x20,0x20,0x21,0x20,0x1F,0x10,0x10,0x1F,0x11,0x10,0x10,0x00,0x00,0x00,0x00
- };
- //******液
- unsigned char code oo[2][16]={
- 0x00,0x20,0x42,0x84,0x88,0x68,0x18,0xC9,0x7A,0xA4,0xE4,0x04,0x00,0x00,0x00,0x00,
- 0x00,0x08,0x1E,0x01,0x00,0x3F,0x21,0x10,0x0B,0x06,0x09,0x10,0x20,0x20,0x00,0x00
- };
- //******晶
- unsigned char code pp[2][16]={
- 0x00,0x00,0x00,0x00,0xBE,0xAA,0x2A,0x95,0x95,0x9F,0x40,0xC0,0x00,0x00,0x00,0x00,
- 0x00,0x3F,0x25,0x15,0x10,0x3F,0x00,0x3F,0x12,0x12,0x08,0x1F,0x00,0x00,0x00,0x00
- };
- //******屏
- unsigned char code qq[2][16]={
- 0x00,0x00,0x00,0xFE,0x0A,0x5A,0xEA,0x49,0x65,0xDD,0x27,0x20,0x00,0x00,0x00,0x00,
- 0x20,0x10,0x0C,0x23,0x12,0x0E,0x03,0x02,0x02,0x3F,0x01,0x01,0x01,0x00,0x00,0x00
- };
- //******术
- unsigned char code rr[2][16]={
- 0x00,0x00,0x20,0x20,0x20,0xE0,0x20,0xFF,0x20,0xD0,0x12,0x14,0x10,0x00,0x00,0x00,
- 0x20,0x10,0x08,0x04,0x03,0x00,0x00,0x3F,0x00,0x00,0x01,0x02,0x0C,0x08,0x08,0x00
- };
- //******欢
- unsigned char code ss[2][16]={
- 0x00,0x00,0x08,0x28,0x48,0x84,0x7C,0x80,0x60,0x1F,0xD0,0x10,0x30,0x10,0x00,0x00,
- 0x20,0x20,0x10,0x08,0x06,0x01,0x26,0x10,0x08,0x06,0x01,0x0E,0x30,0x20,0x20,0x000
- };
- //******迎
- unsigned char code tt[2][16]={
- 0x00,0x40,0x40,0x24,0xE8,0x00,0xFC,0x04,0x82,0x42,0xF8,0x08,0x04,0xFC,0x00,0x00,
- 0x00,0x08,0x08,0x09,0x0E,0x08,0x11,0x11,0x10,0x20,0x2F,0x21,0x22,0x21,0x20,0x00
- };
- //******使
- unsigned char code uu[2][16]={
- 0x40,0x20,0xF8,0x06,0x01,0xE8,0x28,0x28,0xFF,0x94,0x94,0xF4,0x04,0x00,0x00,0x00,
- 0x00,0x00,0x3F,0x00,0x20,0x13,0x0D,0x07,0x08,0x10,0x20,0x20,0x20,0x00,0x00,0x00
- };
- //******用
- unsigned char code vv[2][16]={
- 0x00,0x00,0x00,0xFC,0x24,0x24,0xFC,0x92,0x92,0x92,0x02,0xFE,0x00,0x00,0x00,0x00,
- 0x20,0x18,0x06,0x01,0x01,0x01,0x3F,0x00,0x00,0x00,0x10,0x3F,0x00,0x00,0x00,0x00
- };
- //******地
- unsigned char code ww[2][16]={
- 0x00,0x20,0x20,0xFE,0x20,0xA0,0x40,0xF8,0x40,0x20,0xFE,0x20,0xF0,0x00,0x00,0x00,
- 0x00,0x18,0x08,0x0F,0x08,0x04,0x00,0x3F,0x20,0x20,0x2F,0x22,0x23,0x30,0x00,0x00
- };
- //******址
- unsigned char code xx[2][16]={
- 0x00,0x20,0x20,0xFC,0x20,0x20,0x00,0xF0,0x00,0x00,0xFE,0x40,0x40,0x40,0x00,0x00,
- 0x00,0x18,0x08,0x0F,0x0C,0x24,0x20,0x3F,0x20,0x20,0x3F,0x20,0x20,0x20,0x00,0x00
- };
- //******中
- unsigned char code yy[2][16]={
- 0x00,0x00,0x00,0xE0,0x20,0x20,0x24,0xFC,0x20,0x20,0x20,0xE0,0x60,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00
- };
- //******山
- unsigned char code zz[2][16]={
- 0x00,0x00,0x80,0x00,0x00,0x00,0x04,0xFC,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1F,0x08,0x08,0x08,0x0F,0x08,0x04,0x04,0x04,0x1F,0x00,0x00,0x00
- };
- //******东
- unsigned char code a[2][16]={
- 0x00,0x00,0x20,0x20,0xA0,0x60,0x1C,0xEC,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x13,0x0E,0x22,0x61,0x7F,0x01,0x01,0x01,0x18,0x30,0x00,0x00,0x00
- };
- //******路
- unsigned char code b[2][16]={
- 0x00,0x00,0x00,0x70,0x50,0xF0,0x10,0xC0,0xB0,0xAC,0x60,0x20,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x09,0x0F,0x08,0x07,0x05,0x1A,0x25,0x24,0x15,0x0E,0x02,0x02,0x00,0x00
- };
- //******号
- unsigned char code c[2][16]={
- 0x00,0x00,0x00,0x00,0x00,0x18,0xE8,0x48,0xC8,0xB8,0x88,0x80,0x80,0x80,0x00,0x00,
- 0x00,0x00,0x01,0x01,0x01,0x05,0x22,0x43,0x62,0x3E,0x00,0x00,0x00,0x00,0x00,0x00
- };
- //******二
- unsigned char code d[2][16]={
- 0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x04,0x04,0x04,0x04,0x04,0x0C,0x00,0x00
- };
- //******楼
- unsigned char code e[2][16]={
- 0x00,0x00,0x00,0x80,0xF8,0x40,0x40,0x50,0xC4,0xFC,0x60,0xB8,0x20,0x00,0x00,0x00,
- 0x00,0x08,0x04,0x03,0x7E,0x09,0x49,0x45,0x2E,0x15,0x2E,0x24,0x43,0x07,0x00,0x00
- };
- //******电
- unsigned char code f[2][16]={
- 0x00,0x00,0xF0,0x90,0x90,0x90,0x90,0xFC,0x90,0x90,0x90,0xF0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x7F,0x44,0x44,0x44,0x4F,0x40,0x60,0x10,0x00
- };
- //******话
- unsigned char code g[2][16]={
- 0x00,0x40,0x44,0xD8,0x40,0x40,0x48,0x48,0x48,0xF8,0x44,0x44,0x44,0x40,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0x10,0x08,0x00,0x7E,0x22,0x23,0x22,0x22,0x7E,0x00,0x00,0x00
- };
- //******传
- unsigned char code h[2][16]={
- 0x00,0x80,0x60,0xF8,0x84,0x90,0x90,0x90,0xF8,0x94,0x90,0x90,0x90,0x80,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x13,0x12,0x22,0x32,0x4A,0x06,0x00,0x00,0x00
- };
- //******真
- unsigned char code i[2][16]={
- 0x00,0x08,0x08,0xE8,0xA8,0xA8,0xB8,0xAC,0xA8,0xA8,0xA8,0xE8,0x08,0x00,0x00,0x00,
- 0x00,0x20,0x60,0x7F,0x2A,0x3A,0x2A,0x2A,0x2A,0x2A,0x2A,0x7F,0x60,0x60,0x00,0x00
- };
- //******冒号
- unsigned char code j[2][16]={
- 0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x31,0x7B,0x7B,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
- };
- //******句号
- unsigned char code k[2][16]={
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x38,0x7C,0x44,0x44,0x7C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
- };
- //******11
- unsigned char code l[2][16]={
- 0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,
- 0x00,0x10,0x10,0x1F,0x10,0x10,0x00,0x00,0x00,0x10,0x10,0x1F,0x10,0x10,0x00,0x00
- };
- //******0
- unsigned char code m[2][16]={
- 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x07,0x08,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
- };
- //******23
- unsigned char code n[2][16]={
- 0x00,0x30,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,
- 0x00,0x18,0x14,0x12,0x11,0x10,0x18,0x00,0x00,0x0C,0x10,0x10,0x10,0x11,0x0E,0x00
- };
- //******02
- unsigned char code o[2][16]={
- 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x30,0x08,0x08,0x08,0x88,0x70,0x00,
- 0x00,0x07,0x08,0x10,0x10,0x08,0x07,0x00,0x00,0x18,0x14,0x12,0x11,0x10,0x18,0x00
- };
- //******5-
- unsigned char code p[2][16]={
- 0x00,0xF8,0x88,0x48,0x48,0x48,0x88,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
- 0x00,0x0C,0x10,0x10,0x10,0x10,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
- };
- //******84
- unsigned char code q[2][16]={
- 0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,0x00,0x80,0x40,0x20,0xF8,0x00,0x00,0x00,
- 0x00,0x0E,0x11,0x10,0x10,0x11,0x0E,0x00,0x00,0x03,0x02,0x12,0x1F,0x12,0x12,0x00
- };
- //******53
- unsigned char code r[2][16]={
- 0x00,0xF8,0x88,0x48,0x48,0x48,0x88,0x00,0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,
- 0x00,0x0C,0x10,0x10,0x10,0x10,0x0F,0x00,0x00,0x0C,0x10,0x10,0x10,0x11,0x0E,0x00
- };
- //******28
- unsigned char code s[2][16]={
- 0x00,0x30,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,
- 0x00,0x18,0x14,0x12,0x11,0x10,0x18,0x00,0x00,0x0E,0x11,0x10,0x10,0x11,0x0E,0x00
- };
- //******68
- unsigned char code t[2][16]={
- 0x00,0xE0,0x10,0x88,0x88,0x98,0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x70,0x00,
- 0x00,0x0F,0x11,0x10,0x10,0x10,0x0F,0x00,0x00,0x0E,0x11,0x10,0x10,0x11,0x0E,0x00
- };
- //******41
- unsigned char code u[2][16]={
- 0x00,0x80,0x40,0x20,0xF8,0x00,0x00,0x00,0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,
- 0x00,0x03,0x02,0x12,0x1F,0x12,0x12,0x00,0x00,0x10,0x10,0x1F,0x10,0x10,0x00,0x00
- };
- //******46
- unsigned char code v[2][16]={
- 0x00,0x80,0x40,0x20,0xF8,0x00,0x00,0x00,0x00,0xE0,0x10,0x88,0x88,0x98,0x00,0x00,
- 0x00,0x03,0x02,0x12,0x1F,0x12,0x12,0x00,0x00,0x0F,0x11,0x10,0x10,0x10,0x0F,0x00
- };
-
- //*****图形沙漏***//
- unsigned char code w1[2][16]={
- 0x00,0x00,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,0x7F,0x3F,0x1F,0x0F,0x07,0x00,0x00,
- 0x00,0x00,0xE0,0x90,0x88,0x84,0x82,0x81,0x81,0x82,0x84,0x88,0x90,0xE0,0x00,0x00
- };
- unsigned char code w2[2][16]={
- 0x00,0x00,0x07,0x0D,0x1D,0x3D,0x7D,0xFD,0xFD,0x7D,0x3D,0x1D,0x0D,0x07,0x00,0x00,
- 0x00,0x00,0xE0,0xD0,0xC8,0xC4,0xC2,0xC1,0xC1,0xC2,0xC4,0xC8,0xD0,0xE0,0x00,0x00
- };
- unsigned char code w3[2][16]={
- 0x00,0x00,0x07,0x09,0x19,0x39,0x79,0xF9,0xF9,0x79,0x39,0x19,0x09,0x07,0x00,0x00,
- 0x00,0x00,0xE0,0xF0,0xE8,0xE4,0xE2,0xE1,0xE1,0xE2,0xE4,0xE8,0xF0,0xE0,0x00,0x00
- };
- unsigned char code w4[2][16]={
- 0x00,0x00,0x07,0x09,0x11,0x31,0x71,0xF1,0xF1,0x71,0x31,0x11,0x09,0x07,0x00,0x00,
- 0x00,0x00,0xE0,0xF0,0xF8,0xF4,0xF2,0xF1,0xF1,0xF2,0xF4,0xF8,0xF0,0xE0,0x00,0x00
- };
- unsigned char code w5[2][16]={
- 0x00,0x00,0x07,0x09,0x11,0x21,0x61,0xE1,0xE1,0x61,0x21,0x11,0x09,0x07,0x00,0x00,
- 0x00,0x00,0xE0,0xF0,0xF8,0xFC,0xFA,0xF9,0xF9,0xFA,0xFC,0xF8,0xF0,0xE0,0x00,0x00
- };
- unsigned char code w6[2][16]={
- 0x00,0x00,0x07,0x09,0x11,0x21,0x41,0xC1,0xC1,0x41,0x21,0x11,0x09,0x07,0x00,0x00,
- 0x00,0x00,0xE0,0xF0,0xF8,0xFC,0xFE,0xFD,0xFD,0xFE,0xFC,0xF8,0xF0,0xE0,0x00,0x00
- };
- unsigned char code w7[2][16]={
- 0x00,0x00,0x07,0x09,0x11,0x21,0x41,0x81,0x81,0x41,0x21,0x11,0x09,0x07,0x00,0x00,
- 0x00,0x00,0xE0,0xF0,0xF8,0xFC,0xFE,0xFF,0xFF,0xFE,0xFC,0xF8,0xF0,0xE0,0x00,0x00
- };
- unsigned char code w8[2][16]={
- 0xFC,0x04,0x04,0x08,0x10,0x20,0x40,0x80,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFC,0xFC,
- 0x3F,0x20,0x20,0x10,0x08,0x04,0x02,0x01,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x3F,0x3F
- };
- ///****delay MS****/
- void delay(unsigned int n)
- {
- while(n--)
- {
- unsigned char i;
- for(i=125;i>0;i--);
- }
- }
- //******查忙****///
- void busy()
- {
- p_di=0;
- p_rw=1;
- while(1)
- {
- p_e=1;
- if(Data<0x80)break;
- p_e=0;
- }
- p_e=0;
- }
- ///*****初始化******///
- void Init()
- {
- //开显示;
- p_di=0;
- p_rw=0;
- Data=0x3f;
- p_cs1=0;
- p_cs2=1;
- p_e=1;
- p_e=0;
- p_cs1=1;
- p_cs2=0;
- p_e=1;
- p_e=0;
- //0行开始显示
- busy();
- p_cs1=0;
- p_cs2=1;
- Data=0xc0;
- p_e=1;
- p_e=0;
- p_cs1=1;
- p_cs2=0;
- p_e=1;
- p_e=0;
- }
- void setxy(unsigned char x,unsigned char y)
- {
- if(y<64)
- {
- //***写行地址l**//
- busy();
- p_di=p_rw=p_cs1=0;
- p_cs2=1;
- Data=0xb8|x;
- p_e=1;
- p_e=0;
- ///***写列地址l**//
- busy();
- p_di=p_rw=p_cs1=0;
- p_cs2=1;
- Data=0x40|y;
- p_e=1;
- p_e=0;
- }
- else
- {
- //***写行地址r**//
- busy();
- p_di=p_rw=p_cs2=0;
- p_cs1=1;
- Data = 0xb8|x;
- p_e=1;
- p_e=0;
- ///***写列地址r**//
- busy();
- p_di=p_rw=p_cs2=0;
- p_cs1=1;
- Data=0x40|y;
- p_e=1;
- p_e=0;
- }
- }
- //****写数据****//
- void whitedata(unsigned char x,unsigned char y)
- {
- busy();
- setxy(x,y);//set x,y address address
- if(y<64)
- {
- p_rw=p_cs1=0;
- p_cs2=1;
- }
- else
- {
- p_rw=p_cs2=0;
- p_cs1=0;
- }
- p_di=1;
- Data=0x00;
- p_e=1;
- p_e=0;
- }
- ///******* 显示字******///
- void whiteword(unsigned char x,unsigned char y,unsigned char d[2][16])
- {
- unsigned char i,j;
- for(i=0;i<2;i++)
- for(j=0;j<16;j++)
- {
- busy();
- setxy(i+x,j+y);
- if(y<64)
- {
- p_rw=p_cs1=0;
- p_di=1;
- p_cs2=1;
- }
- else
- {
- p_rw=p_cs2=0;
- p_di=1;
- p_cs1=1;
- }
- Data=d[i][j];
- p_e=1;
- p_e=0;
- }
- }
- ///****清屏***//
- void clear()
- {
- unsigned char i,j;
- for(i=0;i<8;i++)
- for(j=0;j<128;j++)
- whitedata(i,j);
- }
- ///***主函数****///
- void main(void)
- {
- unsigned char z;
- Init();
- while(1)
- {
- clear();
- busy();
- whiteword(0,0,ee);//南
- whiteword(0,16,ff);//京
- whiteword(0,32,aa);//绝
- whiteword(0,48,bb);//妙
- whiteword(0,64,cc);//科
- whiteword(0,80,dd);//技
- whiteword(0,96,gg);//发
- whiteword(0,112,hh);//展
- whiteword(2,0,ii); //有
- whiteword(2,16,jj); //限
- whiteword(2,32,kk); //公
- whiteword(2,48,ll); //司
- whiteword(2,64,k); //句号
- whiteword(2,80,mm); //专
- whiteword(2,96,nn); //业
- whiteword(2,112,oo);//液
- whiteword(4,0,pp); //晶
- whiteword(4,16,qq); //屏
- whiteword(4,32,dd); //技
- whiteword(4,48,rr); //术
- whiteword(4,64,k); //句号
- whiteword(4,80,ss); //欢
- whiteword(4,96,tt); //迎
- whiteword(4,112,uu); //使
- whiteword(6,0,vv); //用
- whiteword(6,16,k); //句号
- for(z=0;z<2;z++)
- {
- whiteword(6,64,w1);
- delay(150);
- whiteword(6,64,w2);
- delay(150);
- whiteword(6,64,w3);
- delay(150);
- whiteword(6,64,w4);
- delay(150);
- whiteword(6,64,w5);
- delay(150);
- whiteword(6,64,w6);
- delay(150);
- whiteword(6,64,w7);
- delay(150);
- whiteword(6,64,w8);
- delay(150);
- }
- clear();
- ///**第二屏**/
- busy();
- whiteword(0,0,ww);//地
- whiteword(0,16,xx);//址
- whiteword(0,32,j); //:
- whiteword(0,48,yy);//中
- whiteword(0,64,zz);//山
- whiteword(0,80,a);//东
- whiteword(0,96,b);//路
- whiteword(2,0,l); //11
- whiteword(2,16,m); //0
- whiteword(2,32,c); //号
- whiteword(2,48,d); //二
- whiteword(2,64,e); //楼
- whiteword(2,80,n); //23
- whiteword(2,96,c); //号
- whiteword(2,112,k);//句号
- whiteword(4,0,f); //电
- whiteword(4,16,g); //话
- whiteword(4,32,o); //02
- whiteword(4,48,p); //5-
- whiteword(4,64,q); //84
- whiteword(4,80,r); //53
- whiteword(4,96,s); //28
- whiteword(4,112,t); //68
- whiteword(6,0,h); //传
- whiteword(6,16,i); //真
- whiteword(6,32,o); //02
- whiteword(6,48,p); //5-
- whiteword(6,64,q); //84
- whiteword(6,80,u); //41
- whiteword(6,96,n); //23
- whiteword(6,112,v); //46
- delay(2000);
- }
- }
复制代码 |