protues中无字库12864汉字显示程序

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
if(lie1>63)
lie1=0;
}
page=5;
lie1=0;
for(i=0;i<8;i++)
{
if(i<4)
screen(0);
else
screen(1);
show1616(page,lie1,address);
lie1+=16;
if(lie1>63)
lie1=0;
address+=32;
}
screen(2);
{
uchar i;
page(pa);
lie(li);
for(i=0;i<16;i++)
dat(*(add++));
page(pa+1);
lie(li);
for(i=0;i<16;i++)
dat(*(add++));
}
void main()
{
uchar i,page,lie1;
uchar *address;
}
void line(uchar line)
{
line=line&0x3f;
line=line|0xc0;
com(line);
}
void onoff(uchar onoff)
{
if(onoff==1)
com(0x3f);
else
com(0x3e);
}
void reset()
{
reset1=0;
delay(2);
0x80,0x80,0x40,0x20,0x10,0x0C,0x03,0x00,0x03,0x0C,0x10,0x20,0x40,0x80,0x80,0x00,
/*--文字:下--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x02,0x02,0x02,0x02,0x02,0x02,0xFE,0x02,0x02,0x42,0x82,0x02,0x02,0x02,0x02,0x00,
0x00,0x3F,0x10,0x10,0x10,0x3F,0x00,0x00,0x01,0x06,0x40,0x80,0x7F,0x00,0x00,0x00,
/*--文字:代--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x80,0x60,0xF8,0x07,0x20,0x20,0x10,0x10,0x00,
0x00,0x00,0x7F,0x21,0x21,0x21,0x7F,0x80,0x40,0x20,0x13,0x0C,0x33,0x40,0x80,0x00,
};
void delay(uint ms)
{
uchar i;
while(ms--)
for(i=0;i<110;i++)
;
}
void busy()
reset1=1;
delay(2);
RS0=0;
delay(2);
RS1=0;
delay(2);
onoff(1);
}
void init()
{
reset();
onoff(0);
clearscreen(2);
page(0);
lie(0);
line(0);
onoff(1);
}
void show1616(uchar pa,uchar li,uchar *add)
0x01,0x41,0x31,0x0D,0x01,0x41,0x81,0x7F,0x01,0x01,0x05,0x09,0x11,0x61,0x01,0x00,
/*--文字:天--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x40,0x42,0x42,0x42,0x42,0x42,0xFE,0x42,0x42,0x42,0x42,0x42,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x01,0x06,0x00,0x00,0x00,
/*--文字:无--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x40,0x42,0x42,0x42,0xC2,0x7E,0x42,0xC2,0x42,0x42,0x42,0x40,0x40,0x00,0x00,
{
e=1;
rs=0;
rw=1;
P1=0x00;
while(busy1);
}
void dat(uchar dat)
{
rs=1;
rw=0;
P1=dat;
e=1;
delay(5);
e=0;
}
void com(uchar com)
{
rs=0;
rw=0;
P1=com;
e=1;
delay(5);
e=0;
}
void screen(uchar scr)
0x80,0x80,0x40,0x20,0x10,0x0C,0x03,0x00,0x03,0x0C,0x10,0x20,0x40,0x80,0x80,0x00,
/*--文字:杀--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x40,0x40,0x22,0x22,0x14,0x14,0xC8,0x08,0x14,0x14,0x22,0x21,0x40,0x00,0x00,
0x00,0x00,0x7F,0x20,0x10,0x00,0xFF,0x22,0x22,0x22,0x3F,0x22,0x22,0x22,0x20,0x00,
/*--文字:的--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0xF8,0x0C,0x0B,0x08,0x08,0xF8,0x40,0x30,0x8F,0x08,0x08,0x08,0xF8,0x00,0x00,
0x80,0x40,0x20,0x10,0x0C,0x03,0x00,0x00,0x3F,0x40,0x40,0x40,0x40,0x70,0x00,0x00,
/*--文字:人--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x3F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x10,0x20,0x40,0xF8,0x00,
/*--文字:大--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xFF,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,
0x10,0x08,0x04,0x02,0xFF,0x49,0x49,0x49,0x49,0x49,0x49,0xFF,0x00,0x00,0x00,0x00,
/*--文字:归--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0xFC,0x00,0x00,0xFF,0x00,0x04,0x84,0x84,0x84,0x84,0x84,0x84,0xFC,0x00,0x00,
0x00,0x7F,0x21,0x21,0x21,0x21,0x7F,0x00,0x00,0x00,0x43,0x80,0x40,0x3F,0x00,0x00,
/*--文字:时--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0xFC,0x84,0x84,0x84,0xFC,0x00,0x10,0x10,0x10,0x10,0x10,0xFF,0x10,0x10,0x00,
0x00,0xFF,0x12,0x12,0x52,0x92,0x7F,0x00,0x00,0x7E,0x88,0x88,0x84,0x82,0xE0,0x00,
/*--文字:敌--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x20,0x20,0x24,0x24,0xFE,0x23,0x22,0x20,0x80,0x70,0x8F,0x08,0x08,0xF8,0x08,0x00,
onoff(1);
delay(50000);
}
}
{
page(i);
lie(0);
for(j=0;j<64;j++)
dat(0);
}
}
void page(uchar ye)
{
ye=ye&0x07;
ye=ye|0xb8;
com(ye);
}
void lie(uchar lie)//设置列
{
lie=lie&0x3f;
lie=lie|0x40;
com(lie);
sbit cs1=P3^3;
sbit cs2=P3^4;
sbit rw=P3^6;
sbit busy1=P1^7;
const uchar code hz[]={
/*--文字:王--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x02,0x82,0x82,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x82,0x02,0x00,0x00,
{
switch(scr)
{
case 0:cs1=0;cs2=1;break;
case 1:cs1=1;cs2=0;break;
case 2:cs1=0;cs2=0;break;
}
}
void clearscreen(scr)
{
uchar i,j;
screen(scr);
for(i=0;i<8;i++)
0x21,0x21,0x11,0x11,0x09,0x05,0x03,0xFF,0x03,0x05,0x09,0x11,0x11,0x21,0x21,0x00,
/*--文字:谁--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x40,0x42,0xCC,0x00,0x40,0x20,0xF8,0x4F,0x48,0x49,0xFE,0x48,0x48,0x48,0x08,0x00,
#include<reg51.h>
#define uint unsigned int
#define uchar unsigned char
void page(uchar ye);
void lie(uchar lie);
sbit reset1=P3^0;
sbit rs=P3^7;
sbit e=P3^5;
init();
while(1)
{
lie1=0;
page=0;
address=hz;
onoff(0);
for(i=0;i<8;i++)
{
if(i<4)
screen(0);
else
screen(1);
show1616(page,lie1,address);
lie1=lie1+16;
address+=32;
0x00,0x87,0x40,0x30,0x0F,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7F,0x00,0x00,
/*--文字:来--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x00,0x08,0x08,0x28,0xC8,0x08,0x08,0xFF,0x08,0x08,0x88,0x68,0x08,0x08,0x00,0x00,
0x80,0x40,0x20,0x10,0x0C,0x03,0x00,0x00,0x00,0x03,0x0C,0x10,0x20,0x40,0x80,0x00,
/*--文字:能--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x08,0xCC,0x4A,0x49,0x48,0x4A,0xCC,0x18,0x00,0x7F,0x88,0x88,0x84,0x82,0xE0,0x00,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
/*--文字:者--*/
/*--宋体12;此字体下对应的点阵为:宽x高=16x16 --*/
0x20,0x20,0x24,0x24,0x24,0x24,0xBF,0x64,0x24,0x34,0x28,0x24,0x22,0x20,0x20,0x00,
相关文档
最新文档