这个写屏代码是参照网上的,有哪里不对吗?
void OLED_P8x16Str(unsigned char x, y,uchar ch[])
{
unsigned char c=0,i=0,j=0;
while (ch[j]!='\0')
{
c =ch[j]-32;
if(x>120){x=0;y++;}
OLED_Set_Pos(x,y);
for(i=0;i<8;i++)
OLED_WrDat(F8X16[c*16+i]);
OLED_Set_Pos(x,y+1);
for(i=0;i<8;i++)
OLED_WrDat(F8X16[c*16+i+8]);
x+=8;
j++;
}
}
/**********功能描述:显示16*16点阵 显示的坐标(x,y),************/
void OLED_P16x16Ch(unsigned char x, y, N)
{
unsigned char wm=0;
unsigned int adder=32*N;
OLED_Set_Pos(x , y);
for(wm = 0;wm < 16;wm++)
{
OLED_WrDat(F16x16[adder]);
adder += 1;
}
OLED_Set_Pos(x,y + 1);
for(wm = 0;wm < 16;wm++)
{
OLED_WrDat(F16x16[adder]);
adder += 1;
}
} |