【文件属性】:
文件名称:lcd1602汉字显示
文件大小:325KB
文件格式:DOC
更新时间:2012-10-09 05:37:21
1602
1602汉字显示,如有需要可以下载
#include
#define uchar unsigned char
#define uint unsigned int
sbit lcdrs=P1^0;
sbit lcden=P1^2;
sbit lcdwr=P1^1;
uchar CGCODE[]={0x08,0x0F,0x12,0x0F,0x0A,0x1F,0x02,0x02,//"年"代码 0x00
0x0F,0x09,0x0F,0x09,0x0F,0x09,0x13,0x00,//"月"代码 0x01
0x0F,0x09,0x09,0x0F,0x09,0x09,0x0F,0x00,//"日"代码 0x02
0x07,0x04,0x07,0x04,0x07,0x00,0x04,0x07,//"星"左上半部分代码 0x03
0x1F,0x01,0x1F,0x01,0x1F,0x08,0x08,0x1F,//"星"右上半部分代码 0x04
0x08,0x17,0x00,0x1F,0x00,0x00,0x00,0x00,//"星"左下半部分代码 0x05
0x08,0x1F,0x08,0x1F,0x00,0x00,0x00,0x00//"星"右下半部分代码 0x06
};
uchar tab[]={'0','8',0x00,'0','3',0x01,'0','9',0x02};//显示"08年03月09日"
void delay(uint t)
{
uint x,y;
for(x=0;x