程序如下:
//适合LM016L液晶显示器
#include#include#define uchar unsigned char
#define uint unsigned int
void delay_nms(int);
bit LCD_busy();
void LCD_write_cmdata(uchar);
void LCD_write_wodata(uchar);
void LCD_Init();
//端口设置
sbit LCD_RS=P1^2;
sbit LCD_RW=P1^1;
sbit LCD_EA=P1^0;
sbit LCD_BF=P0^7;
uchar dis1[]={" WELCOME TO "};
uchar dis2[]={" wo de cheng xu "};
uchar dis3[]={" WELCOME TO "};
uchar dis4[]={"zz tao xiao shou"};
//延时函数
void delay_nms(int ms)
{
uchar i;
while(ms--)
{
for(i=0;i<250;i++)
{
_nop_();
_nop_();
_nop_();
_nop_();
}