我想打印出一串汉字,结果输出的是一串乱码,难道这个不能输出汉字的吗。ps:我用的是Arduino
//逐列,顺向
static const unsigned char user_hz18x18[][54]=
{
};
void LCD_ShowFont_18x18(u8 x,u8 y,u8 fno,u8 mode)
{
u8 temp,t,t1;
u8 y0=y;
for(t=0;t<54;t++)
{
temp=user_hz18x18[fno][t]; //调用18*18汉字
for(t1=0;t1<8;t1++)
{
if(temp&0x80)LCD_DrawPoint(x,y,mode);
else LCD_DrawPoint(x,y,!mode);
temp<<=1;
y++;
if((y-y0)==18)
{
y=y0;
x++;
break;
}
}
}
}
//12*12字体 顺向取模
static const unsigned char user_hz1212[][24]=
{
};
//用12字体
void LCD_ShowFont_1212(u8 x,u8 y,u8 fno,u8 mode)
{
u8 temp,t,t1;
u8 y0=y;
for(t=0;t<24;t++)
{
temp=user_hz1212[fno][t]; //4
for(t1=0;t1<8;t1++)
{
if(temp&0x80)LCD_DrawPoint(x,y,mode);
else LCD_DrawPoint(x,y,!mode);
temp<<=1;
y++;
if((y-y0)==12)
{
y=y0;
x++;
break;
}
}
}
}
如有帮助请点采纳!
要是只显示几个特定的中文字符,可以将这几个汉字的点阵找出来当图片一样显示。
要想将所有汉字都显示出来就会复杂很多,需要大容量的rom放字库,需要做汉字代码到字库地址的算法,需要能正确的显示汉字点阵。
1,找带中文字库的屏
2,找可以支持任意点控制的屏,软件里包中文字库。
你用的这个屏我看两点都无法满足