作者:李剀 出处:https://www.cnblogs.com/kevin-nancy/p/10531368.html 和
https://blog.csdn.net/Kevin_8_Lee/article/details/88556047
欢迎转载,但也请保留上面这段声明。谢谢!
我使用的是正点原子提供的oled字库,自己用取模软件取字模
PC2LCD2002取模方式设置:阴码+逐列式+顺向+C51格式
附: 代码
//24*24的OLED汉字点阵,包括三个汉字:开、发、板。这三个汉字的点阵库,是利用PCtoLCD2002生产的,
//软件设置的取模方式同OLED实验ASCII的取模方式一模一样,字体采用12*大小,一个汉字点阵占用24字节。
const unsigned char OLED_HZK_TBL[14][24]=
{
{0x00,0x00,0x1F,0x80,0x11,0x00,0x11,0x00,0x11,0x00,0xFF,0xF0,0x11,0x00,0x11,0x00,0x11,0x00,0x1F,0x80,
0x00,0x00,0x00,0x00},/*"中",0*/
{0xFF,0xF0,0x80,0xA0,0xA4,0xA0,0xA4,0xA0,0xA4,0xA0,0xBF,0xA0,0xA4,0xA0,0xA6,0xA0,0xA5,0xA0,0x80,
0xA0,0xFF,0xF0,0x00,0x00},/*"国",1*/
};
同理,若想要32个字节的汉字矩阵,可以将字宽,字高都设为16。 其他大小的也可以这样去设置
ps : 32字节矩阵,字高字宽设为16之后,还得新建一个数组存储。 二维数组列设为36,如下
const unsigned char OLED_HZK_TBL[14][36]=
{
{0x00,0x00,0x00,0x00,0x0F,0xF0,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0xFF,0xFF,0x08,0x20,0x08,
0x20,0x08,0x20,0x08,0x20,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00},/*"中",0*/
{0x00,0x00,0x7F,0xFF,0x40,0x02,0x48,0x12,0x49,0x12,0x49,0x12,0x49,0x12,0x4F,0xF2,0x49,0x12,0x49,
0x52,0x49,0x32,0x48,0x12,0x40,0x02,0x7F,0xFF,0x00,0x00,0x00,0x00},/*"国",1*/
};