//显示一串字符函数
void LineChar_1608t(u8 Page,u8 List,u8 *pd)
{
u8 temp;
while((*pd)!='\0')
{
temp=*pd;
SHOW_char_NBC(Page,List,temp);
pd++;
List=List+1;
}
}
//透明背景色的显示字符函数
void SHOW_char_NBC(u8 Page,u8 List,u8 onechar)
{
u8 i,j;
u16 temp1,temp2,temp3,temp4;
temp1=onechar-' '; //减去空格
temp3=F_COLOR;
for(i=0;i<16;i++)
{
temp4=asc2_1608[temp1]; //取出字模
for(j=0;j<8;j++)//取出每一个位
{
temp2=temp4;
temp2&=0x01;
temp4>>=1;
if(temp2==0)
{
F_COLOR=LCD_ReadPoint(List*8+j,Page*16+i); //把读出来的颜色原位写回去
}
else
{
F_COLOR=temp3; //是1的地方 画上前景色
}
LCD_WriteReg(0x20,List*8+j);
LCD_WriteReg(0x21,Page*16+i);
LCD_WR_REG(0X22);
LCD_WR_DATA(F_COLOR);
}
}
}
主函数调用:
F_COLOR=color(0,60,0);
LineChar_1608t(3,6,"This is char show\0");
为什么屏幕上只显示一个'T' ,后面的字符为什么显示不出来呀? 求解释? |