原创 6963驱动 12864液晶 C程序字节写

2009-8-13 17:08 1700 0 分类: MCU/ 嵌入式
#ifndef __lcd12864_h__
#define __lcd12864_h__

#include <reg51.h>
#include <intrins.h>
#include <math.h>


/**********************************************************
引脚定义
**********************************************************/
//lcd引线定义,本程序采用间接方式
sbit cd = P0^7; //lcd命令数据选择线
sbit cs = P0^6; //lcd片选线
sbit rd = P0^5; //lcd读选择线
sbit wr = P0^4; //lcd写选择线
sbit rest="P0"^3;
 /**********************************************************
File Name: delay(int)
Function: 延时
Author: shgch
Date: 2008-8-31
Explain
**********************************************************/
void delay(unsigned int m)
{
unsigned int i,j;
for (i=0;i<m;i++)
{
for (j=0;j<m;j++);
}
}
//单片机初始化
void Init_Device(void)
{ rest="0";
  delay(150) ;
  rest="1";
  P2=0xff;P3=0xff;

  }
/**********************************************************
File Name: char test()
Function: 读忙标志位
Author: shgch
Date: 2008-8-30
K:\lcd.c 2
Explain : 返回状态标志位
**********************************************************/
unsigned char test (void )
{
wr = 1;
P3 = 0xff;
cd = 1;
cs = 0;
rd = 0;
rd = 1;
return (P3);
}
/**********************************************************
File Name: clear
Function: 查忙
Author: shgch
Date: 2008-8-30
Explain
**********************************************************/
bit busy1( void ) //查读写状态
{
unsigned char buf;
buf = test() & 0x03;
if ( buf == 0x03 )
{
return (1);
}
else
{
return (0);
}
}

/**********************************************************
File Name: w_byte(unsigned char,bit)
Function: 命令或数据写入
Author: shgch
Date: 2008-8-30
Explain: byte--待写入数据或命令
m = 0;数据
m = 1;命令
**********************************************************/
void w_byte(unsigned char bytes,bit m)
{
while( busy1()!= 1 );
if ( m == 0 )
{ cd=0; _nop_();
 wr=1; _nop_();
 cs=0; _nop_();
 wr=0; _nop_();
    _nop_();
 _nop_();
 _nop_();
 _nop_();
    P3 = bytes;
    cs="1";
    wr="1";
}
if ( m == 1 )
{ cd=1;
 cs=0; _nop_();
 wr=0; _nop_();
    _nop_();
 _nop_();
 _nop_();
 _nop_();
    P3 = bytes;
    cs="1";
    wr="1";
}
}

void clear(bit m,unsigned char t)
{
unsigned int i;
i=1024*2;
if(m == 0)
{
w_byte(0,0);
w_byte(0,0);
w_byte(0x24,1);
}
if(m == 1)
{
w_byte(0,0);
w_byte(0+0x08,0);
w_byte(0x24,1);
}
w_byte(0xb0,1);
while(i--)
{
w_byte(0,0);
delay(t);
}
w_byte(0xb2,1);
}


/**********************************************************
File Name: initial
Function: 初始化lcd
Author: shgch
Date: 2008-8-31
Explain: 初始化配置如下:
显示文本区首地址为:0x0000;文本显示区宽度为:20h(32)个字节,即256点
图形显示(或文本属性)区首地址为:0x1c00;宽度为256点
光标坐标为0,0;光标形状为:下划线;并关闭光标
内部字符发生器有效,文本与图形以逻辑"异或"的关系组合
文本和图形显示均打开
**********************************************************/
void initial (void)
{
Init_Device(); //初始化单片机设置
clear(0,0); //清屏
clear(1,0);
w_byte(0x00,0);
w_byte(0x00,0);
w_byte(0x40,1); //设置显示文本区

w_byte(0x20,0); //一行占20个字节
w_byte(0x00,0);
w_byte(0x41,1); //设置文本显示区宽度

w_byte(0x00,0); //设置图形显示区首地址
w_byte(0x08,0); //或文本属性区域首地址
w_byte(0x42,1);

w_byte(0x20,0); //图形显示区宽度
w_byte(0x00,0); //或文本属性区宽度
w_byte(0x43,1);

w_byte(0x00,0); //光标地址设置
w_byte(0x00,0);
w_byte(0x21,1);

w_byte(0x81,1); //内部字符发生器有效
w_byte(0xa0,1); //光标形状设置
w_byte(0x9c,1); //显示设置开文本和图形显示
}
/**********************************************************
File Name: clear
Function: 清屏
Author: shgch
Date: 2008-8-30
Explain: m="0";数据区清屏,m=1:图形区清屏
t:清楚一个单元的时间,通过修改时间可以实现
平滑擦除
**********************************************************/

/**********************************************************
File Name: w_c(char,char,char,char)
Function: 西文字符写入
Author: shgch
Date: 2008-8-31
Explain: x - x方向坐标
y - y方向坐标
codes - 字符代码
attr - 字符属性代码
**********************************************************/
void w_c(unsigned char x,unsigned char y,unsigned char codes,unsigned char attr)
{
unsigned int dat;
unsigned char datlow,dathigh;
dat = y * 0x20 +x;
datlow = dat & 0x00ff;
dathigh = ( dat & 0xff00 )>>8;
w_byte(datlow,0);
w_byte(dathigh,0);
w_byte(0x24,1); //设置地址指针
w_byte(codes-0x20,0);//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
w_byte(0xc4,1); //写入数据地址不变
w_byte(datlow,0);
w_byte(dathigh + 0x08,0); //市地址指针指向属性区
w_byte(0x24,1); //设置地址指针
w_byte(attr,0); //写入属性参数
w_byte(0xc4,1);
}

 

/**********************************************************
File Name: w_cc1(char,char,char *char)
Function: 图形方式下写入汉字
Author: shgch
Date: 2008-8-30
Explain: x - x方向坐标
y - y方向坐标
cods - 待写入字符的字符代码
pl-字模存放首地址
**********************************************************/
void w_cc32(unsigned char x,unsigned char y,unsigned char cods,unsigned char *pl)
{
unsigned int dat;
unsigned char i,j;
y=y*8; //x单位是字节,而y方向的单位
//是位为了能以同样的单位计算
//,所以y应乘以8
for(i=0;i<4;i++)
{
dat =4*y * 0x20 +4*x+0x02+i + 0x0800;
for(j=0;j<32;j++)
//K:\lcd.c 6
{
w_byte((dat<<8)>>8,0);
w_byte(dat>>8,0); //图形显示区地址为0x0800
w_byte(0x24,1); //设置地址指针
w_byte(pl[cods*128+j+32*i],0);//cods 表示第几个字,i表示代码的第几行,j表示每行的第几个代码。
w_byte(0xc4,1); //写入数据
dat = dat+32;//没写完一个代码都加32 ,无论
}
}
}
/**********************************************************
File Name: w_cc1(char,char,char *char)
Function: 图形方式下写入汉字
Author: shgch
Date: 2008-8-30
Explain: x - x方向坐标
y - y方向坐标
cods - 待写入字符的字符代码
pl-字模存放首地址
**********************************************************/
void w_cc64(unsigned char x,unsigned char y,unsigned char cods,unsigned char *pl)
{
unsigned int dat;
unsigned char i,j;
y=y*8; //x单位是字节,而y方向的单位
//是位为了能以同样的单位计算
//,所以y应乘以8
for(i=0;i<8;i++)
{
dat =8*y * 0x20 +8*x+i + 0x0800;
for(j=0;j<64;j++)
{
w_byte((dat<<8)>>8,0);
w_byte(dat>>8,0); //图形显示区地址为0x0800
w_byte(0x24,1); //设置地址指针
w_byte(pl[cods*512+j+64*i],0);//cods 表示第几个字,i表示代码的第几行,j表示每行的第几个代码。
w_byte(0xc4,1); //写入数据
dat = dat+32;//没写完一个代码都加32 ,无论
}
}
}
/**********************************************************
File Name: w_cc2(char,char,char *char)
Function: 图形方式下写入汉字
Author: shgch
Date: 2008-8-30
Explain: x - x方向坐标
y - y方向坐标
cods - 待写入字符的字符代码
pl-字模存放首地址
**********************************************************/
void w_cc16(unsigned char x,unsigned char y,unsigned char cods,unsigned char *pl)
{
unsigned int dat;
unsigned char i,j;
y=y*8; //x单位是字节,而y方向的单位
//是位为了能以同样的单位计算
//,所以y应乘以8
for(i=0;i<2;i++)
{
dat =2*y * 0x20 +2*x+i + 0x0800;
for(j=0;j<16;j++)
{
 w_byte((dat<<8)>>8,0);
 w_byte(dat>>8,0); //图形显示区地址为0x0800
 w_byte(0x24,1); //设置地址指针
 w_byte(pl[cods*32+j+16*i],0);//cods 表示第几个字,i表示代码的第几行,j表示每行的第几个代码。
 w_byte(0xc4,1); //写入数据
 dat = dat+32;//没写完一个代码都加32 ,无论字的大小。
}
}
}

#endif

 

 

 

 

#include <reg51.h>
#include <intrins.h>
#include <math.h>
#include <lcd12864zi jie.h>
#define num 10
unsigned char code str[num]="THANK  YOU";
unsigned  char code wx32[][16]={
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x04,0x07,0x0C,0x1C},
 {0x18,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x1C,0x00},
 {0x00,0x00,0x10,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x00,0x00,0xFF,0x02,0x03},
 {0x03,0x03,0x03,0xFE,0x06,0x06,0x06,0x0C,0x0C,0x18,0x30,0x60,0xC0,0x00,0x00,0x00},
 {0x00,0x00,0x08,0x0C,0x08,0x08,0x08,0xFF,0x0C,0x0C,0x08,0x00,0x00,0xFF,0x00,0x00},
 {0x00,0x00,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,0x7F,0x0E,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x18,0x38,0xC0,0x00,0x00,0x00,0x10,0x38,0xFC,0x30,0x40},
 {0x40,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"劳",0
 
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C},
 {0x0C,0x0C,0x0F,0x0C,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x01},
 {0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00},
 {0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xF0,0x20,0x20,0x20,0x20,0x20,0x20},
 {0x20,0x20,0xE0,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//"中",1
 
 {0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x0F,0x1C,0x18,0x18,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x3F,0x00,0x00},
 {0x00,0x00,0x01,0x01,0xC1,0x71,0x71,0x31,0x31,0x01,0xFE,0x00,0x00,0x7F,0x40,0x40},
 {0x40,0x40,0x40,0x7F,0x41,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0xFF,0x00,0x00},
 {0x00,0x00,0x00,0x80,0x83,0x83,0x86,0x8C,0x88,0x90,0x6F,0x00,0x00,0xFF,0x06,0x06},
 {0x06,0x06,0x06,0xFE,0x86,0x80,0x80,0x81,0xFE,0x80,0x80,0x80,0x80,0xFF,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x10,0x38,0xFC,0x20,0x40,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0x00,0x00,0x00,0x10,0x38,0xFC,0x00,0x00},//"堂",2*/
};
unsigned  char code wx16[][16]={
 {0x20,0x20,0x20,0x23,0xFC,0x20,0x77,0x68,0x68,0xA0,0x23,0x20,0x20,0x20,0x2F,0x20},
 {0x40,0x40,0x40,0xFC,0x40,0x40,0xFE,0x00,0x40,0x40,0xFC,0x40,0x40,0x40,0xFE,0x00},/*"桂",0*/
 
 {0x10,0x10,0x10,0x10,0xFD,0x10,0x10,0x38,0x34,0x54,0x51,0x92,0x14,0x10,0x10,0x10},
 {0x20,0x20,0x20,0x20,0xFE,0x20,0x60,0x70,0xB0,0xA8,0x28,0x26,0x24,0x20,0x20,0x20},/*"林",1*/
 
 {0x01,0x01,0x01,0x3F,0x21,0x21,0x3F,0x21,0x21,0x21,0x3F,0x21,0x01,0x01,0x00,0x00},
 {0x00,0x00,0x00,0xF8,0x08,0x08,0xF8,0x08,0x08,0x08,0xF8,0x08,0x02,0x02,0xFE,0x00},/*"电",2*/
 
 {0x00,0x3F,0x00,0x00,0x00,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x05,0x02},
 {0x00,0xF0,0x20,0x40,0x80,0x00,0x00,0x04,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"子",3*/
 
 {0x06,0x78,0x08,0x08,0xFE,0x18,0x1C,0x2A,0x28,0x48,0x8B,0x08,0x08,0x08,0x08,0x08},
 {0x08,0x88,0x48,0x48,0x08,0x88,0x48,0x48,0x0E,0x78,0x88,0x08,0x08,0x08,0x08,0x08},/*"科",4*/
 
 {0x10,0x10,0x10,0xFD,0x10,0x14,0x19,0x31,0xD0,0x10,0x10,0x10,0x10,0x11,0x56,0x20},
 {0x20,0x20,0x20,0xFE,0x20,0x20,0xFC,0x08,0x88,0x90,0x60,0x60,0x90,0x0E,0x04,0x00},/*"技",5*/
 
 {0x01,0x01,0x01,0x01,0x01,0xFF,0x01,0x02,0x02,0x02,0x04,0x04,0x08,0x10,0x20,0x40},
 {0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x80,0x80,0x40,0x40,0x20,0x10,0x18,0x0E,0x04},/*"大",6*/
 
 {0x01,0x10,0x0C,0x08,0x7F,0x40,0x8F,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x02,0x01},
 {0x08,0x8C,0xC8,0x90,0xFE,0x04,0xE8,0x40,0x80,0xFE,0x80,0x80,0x80,0x80,0x80,0x00},/*"学",7*/
};
unsigned  char code wx64[][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},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0},
 {0xF0,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0},
 {0xF0,0xF0,0xF0,0xFF,0xF0,0xF0,0xF0,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x06,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07},
 {0x07,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03},
 {0x03,0x03,0x03,0xFF,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07},
 {0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0xC0,0xC0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},
 {0x80,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},
 {0x80,0x80,0x80,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},
 {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00},//
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x0C},
 {0x1E,0xFF,0x1E,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C},
 {0x1C,0x1C,0x1E,0xFE,0x1E,0x1E,0x1E,0x1C,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,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"中",0*/
 
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x40,0x70,0x7F,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70},
 {0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70},
 {0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x71,0x70,0x70},
 {0x70,0x70,0x70,0x70,0x70,0x7F,0x70,0x70,0x70,0x70,0x70,0x60,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x40},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x18,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00},
 {0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x03},
 {0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0x03,0x03,0x03,0x03},
 {0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80},
 {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0x80,0x80,0x80,0x8C},
 {0x87,0x83,0x83,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x04,0x0E,0x1F,0xFF,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x7C,0xFE,0x00,0x00,0x00,0x00},
 {0x00,0xC0,0xE0,0xF0,0xF8,0x78,0x78,0x38,0x30,0x00,0x06,0x0F,0x1F,0xFF,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x06,0x0F,0xFF,0x0F,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x8E,0x0E},
 {0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E},
 {0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x8E,0xCE,0x0E,0x0E},
 {0x0E,0x0E,0x0E,0x0E,0x0E,0xFE,0x0E,0x0E,0x0E,0x0E,0x0C,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"国",0*/
};


void main()
{

 unsigned char k;
 initial();
 clear(0,0); //文本清屏
 clear(1,0); //图形清屏
for(k=0;k<num;k++)  //写字符串,循环写num个
 w_c(k+3,5,str[k],0x00);
 for(k=0;k<3;k++)  //写32*32的汉字,循环写3个
       w_cc32(k,0,k,wx32);   
 for(k=0;k<8;k++)  //写16*16的汉字,循环写8个。
    w_cc16(k,3,k,wx16);
 
 //for(k=0;k<1;k++)   //写64*64的汉字,只写一个
 //   w_cc64(k,0,k,wx64);      
 while(5);

}
PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
0
关闭 站长推荐上一条 /4 下一条