|
部分程序如下:
sbit RS=P1^0;
sbit RW=P1^1;
sbit E=P1^2;
#define LCDData P0
void Write_Instruction(uchar x) //液晶写指令函数
{
Delay(1000);
E=0;
RW=0;
RS=0;
LCDData=x;
E=1;
Delay(20);
E=0;
}
void Write_Data(uchar x) //写单个数据
{
Delay(1000);
E=0;
RW=0;
RS=1;
E=1;
LCDData=x;
E=0;
}
void Write_String(uchar x,uchar y,uchar *s)//写一字符串
{
while (*s)
{
LCD_Write_Char(x,y,*s); //写入字符函数,x为地址,y为行数
s ++;
x++;
}
}
|
|