void delay(int ms)
{
int ii,jj;
if (ms<1) ms=1;
for(ii=0;ii<ms;ii++)
for(jj=0;jj<500;jj++);
}
/****主函数*****/
void main(void)
{
OLED_Init();
delay(5);
while(1)
{
OLED_ShowCN(3,0,1);
OLED_ShowCN(21,0,2);
delay(500);
//delay(500);
//OLED_Fill(0xff);
//delay(1000);
}
}
/*******************************************
//OLED: x,y -- 起始点坐标(x:0~127, y:0~7); N:汉字在codetab.h中的索引 ----OK
********************************************/
void OLED_ShowCN(unsigned char x, unsigned char y, unsigned char N)
{
unsigned char wm=0;
unsigned int adder=32*N;
OLED_SetPos(x , y);
for(wm = 0;wm < 16;wm++)
{
Write_IIC_Data(F16x16[adder]);
adder += 1;
}
OLED_SetPos(x,y + 1);
for(wm = 0;wm < 16;wm++)
{
Write_IIC_Data(F16x16[adder]);
adder += 1;
}
}/***************************16*16的点阵字体取模方式:共阴——列行式——逆向输出*********/
const unsigned char F16x16[] =
{
0x7F,0x8F,0xFF,0x00,0xDF,0xEF,0xF7,0xB7,0xB7,0x00,0xB7,0xB7,0xB7,0xB7,0xF7,0xFF,
0x7F,0x9F,0xE7,0xF8,0xF7,0xCF,0xFD,0xFD,0xFD,0x00,0xFD,0xFD,0xED,0xDD,0xE1,0xFF,//"炜",0
0x80,0x70,0x00,0xFF,0x20,0x10,0x08,0x48,0x48,0xFF,0x48,0x48,0x48,0x48,0x08,0x00,
0x80,0x60,0x18,0x07,0x08,0x30,0x02,0x02,0x02,0xFF,0x02,0x02,0x12,0x22,0x1E,0x00,//"炜",0
};
引脚设置没问题,程序能成功编译
我也是刚学习这个的,,取的字模都是按设定,共阴——列行式——逆向输出,描点函数指的是这个吗
/*******************************************
//OLED: x,y -- 起始点坐标(x:0~127, y:0~7); N:汉字在codetab.h中的索引 ----OK
********************************************/
void OLED_ShowCN(unsigned char x, unsigned char y, unsigned char N)
{
unsigned char wm=0;
unsigned int adder=32*N;
OLED_SetPos(x , y);
for(wm = 0;wm < 16;wm++)
{
Write_IIC_Data(F16x16[adder]);
adder += 1;
}
OLED_SetPos(x,y + 1);
for(wm = 0;wm < 16;wm++)
{
Write_IIC_Data(F16x16[adder]);
adder += 1;
}
}
用的也都是网上能获取的例程拿来用的,图片能显示,汉字就不能显示很困惑
谢谢你的建议,改了另一个例程,能够成功显示了,问了懂的朋友,说是oled中的函数有问题,相信日后会慢慢把问题找出来
一周热门 更多>