@[TOC]
1.汉字取模
1.1.打开取模软件
1.2.选择字符模式
1.3 设置取模方式
1.4 编写代码
unsigned char hanzi[][16]=
{
//将上面生成的字模放到这里
{0x00,0x00,0x00,0xFE,0x92,0x92,0x92,0xFE,0x92,0x92,0x92,0xFE,0x00,0x00,0x00,0x00},
{0x44,0x44,0x24,0x25,0x14,0x0C,0x04,0xFF,0x04,0x0C,0x14,0x25,0x24,0x44,0x44,0x00},/*"果",0*/
{0x00,0x00,0x00,0xFE,0x92,0x92,0x92,0xFE,0x92,0x92,0x92,0xFE,0x00,0x00,0x00,0x00},
{0x44,0x44,0x24,0x25,0x14,0x0C,0x04,0xFF,0x04,0x0C,0x14,0x25,0x24,0x44,0x44,0x00},/*"果",1*/
{0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x20,0x40,0x80,0x00,0x00},
{0x08,0x04,0x03,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x01,0x0E,0x00},/*"小",2*/
{0x00,0xFC,0x00,0x00,0xFF,0x00,0x02,0xE2,0x22,0x22,0xFE,0x22,0x22,0xE2,0x02,0x00},
{0x00,0x87,0x40,0x30,0x0F,0x00,0x00,0x1F,0x00,0x00,0xFF,0x08,0x10,0x0F,0x00,0x00},/*"师",3*/
{0x00,0x08,0xC8,0x48,0x49,0x4E,0x48,0xF8,0x48,0x4C,0x4B,0x48,0x78,0x00,0x00,0x00},
{0x00,0x40,0x43,0x22,0x12,0x0A,0x06,0xFF,0x02,0x02,0x02,0x12,0x22,0x1E,0x00,0x00},/*"弟",4*/
};
将上面的代码复制到==oledfont.h==文件中
1.5 显示汉字
在主函数中调用相应的函数就可以显示汉字
OLED_ShowCHinese16x16(0, 0,0,Hanzi);//果(0)
OLED_ShowCHinese16x16(16,0,1,Hanzi);//果(1)
OLED_ShowCHinese16x16(32,0,2,Hanzi);//小(2)
OLED_ShowCHinese16x16(48,0,3,Hanzi);//师(3)
OLED_ShowCHinese16x16(64,0,4,Hanzi);//弟(4)
2.图片取模
2.1.打开取模软件
2.2.打开一张BMP图片
2.3.选择图形模式
2.4.生成代码
方法与生成字模的代码方法相同
关注微信公众号:[果果小师弟],获取更多精彩内容!
智果芯—服务于百万大学生和电子工程师