这玩意是用来显示的
头文件
lcd1602.c
`
#include"lcd.h"
/*****************************************************
判断液晶模块的忙碌状态
***************************************************/
bit BusyTest(void)
{
bit result;
rs=0; //根据规定,RS为低电平,RW为高电平时,可以读状态
rw=1; //只有rs=0,rw=1的时候才能读忙信号
e=1; //E=1,才允许读写
_nop_(); //空操作
_nop_();
_nop_();
_nop_(); //空操作四个机器周期,给硬件反应时间
result=bf; //将忙碌标志电平赋给result
e=0; //将E恢复低电平
return result;
}
void LCD_set_xy(uchar x,uchar y)//定位函数
{
if(y==0)
{
LcdWriteCom(0x80+x);//第一行
}
if(y==1)
{
LcdWriteCom(0xc0+x);//第二行
}
}
void LCDWrite_String(uchar x, uchar y, uchar *s) //定位显示字符串函数x 0~15 , y 0,1
{
LCD_set_xy(x,y);//先定位
while(*s)//直到整串显示完
{
LcdWriteData(*s);//显示数据
s++;
}
}
void Lcd1602_Delay1ms(uint16 i)
{
whi