液晶显示程序:#includereg52.hsbiten=P2^6;sbitrs=P2^4;sbitrw=P2^5;unsignedcharcodea[]={Myfaveryis:};//显示的数据unsignedcharcodeb[]={bugaosuni!};//显示的数据unsignedinti,j;voiddelay(unsignedcharz)//延时子函数{unsignedintx,y;for(x=z;x0;x--)for(y=110;y0;y--);}voidwrite_ml(unsignedcharM)//写命令子函数{rs=0;P0=M;delay(5);en=1;delay(5);en=0;}voidcsh()//初始化子函数{rw=0;en=0;write_ml(0x38);write_ml(0x0f);write_ml(0x06);write_ml(0x01);write_ml(0x80+0x10);}voidwrite_sj(S)//写数据子函数{rs=1;P0=S;delay(5);en=1;delay(5);en=0;}voidmain()//主函数{csh();for(i=0;i14;i++){write_sj(a[i]);delay(20);}write_ml(0x80+0x53);for(i=0;i13;i++){write_sj(b[i]);delay(20);}for(i=0;i16;i++){write_ml(0x18);delay(500);}P2=0;P0=0x00;while(1);}