/*-----------------------------------------------------
函数名称:LCD_write_string
函数功能:显示字符串,可以中英文同时显示
输入参数:x 横坐标(列)
y 纵坐标(行)
*s 需要显示的字符串
编写日期:20120525
------------------------------------------------------*/
void LCD_write_string(unsigned char x, unsigned char y, unsigned char *s)
{
unsigned char l=0;
while(*s)
{
if( *s < 0x80)
{
LCD_write_char(x+l,y,*s);
s++;l++;
}
else
{
LCD_write_hanzi(x+l,y,(unsigned char*)s);
s+=2;l+=2;
}
}
}
就是上面这段程序,在51里面好用,在PIC里为什么不好用呢?
我调用时这样:
LCD_write_string(0,0,"123");
请高手指教,谢谢! |