原创 C51 温湿度传感器DHT11驱动 LCD1602显示程序 硬件通过 含电路图和实际测试效果图
}
/**************************************************************************** * 名 称:LCD_set_xy( uchar x, uchar y ) the optic sign flash?
* 功 能:指定一个地址
* 入口参数:X:横坐标 Y:纵坐标
* 出口参数:无
* 范 例: LCD_set_xy(5,1)
*************CD_set_xy***************************************************************/
void LCD_set_xy( uchar x, uchar y ) //写地址函数
{
unsigned char address;
if (y == 0) address = 0x80 + x;
else
address = 0xc0 + x;
LCD_write_char( address, 0 );
}
/**************************************************************************** * 名 称:LCD_en_write(void)
* 功 能:液晶使能
* 入口参数:无
* 出口参数:无
* 范 例: 直接调用
*************CD_set_xy***************************************************************/
void LCD_en_write(void) //液晶使能
{
_nop_();
LCD_E=1;//EN=1
_nop_();
LCD_E=0;//EN=0
}
//------------------------------------------------
/**************************************************************************** * 名 称:LCD_write_char(uchar cd,uchar ab)