下载取模软件
网址:
链接: link.
下载完成解压后打开:
设置成这样:
转换一下输出的进制:
这样就可以得到自己想要的子模啦!
通过OLED显示自己的姓名学号
用keil打开之前下载好的程序包:
编译程序,然后打开oledfont.h
将自己生成的子模按照它的格式粘贴上去:
main.c修改为:
#include "delay.h"
#include "sys.h"
#include "oled.h"
#include "bmp.h"
int main(void)
{
u8 t;
delay_init(); //延时函数初始化
NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级 LED_Init(); //LED端口初始化
// delay_ms(8000);
OLED_Init(); //初始化OLED
OLED_Clear(0) ;
t=' ';
while(1)
{
OLED_ShowCHinese(6,0,0);//马
OLED_ShowCHinese(26,0,1);//昕
OLED_ShowString(4,3,"631807030221",16);
t++;
}
}
编译:
然后将程序烧录进进去
结果:
通过OLED显示AHT20的温度和湿度
AHT20工程代码:
链接: link.
添加几个文件进去,具体文件参考之前的博客:
链接: link.
生成子模:
"温",0x00,0x00,0x23,0xF8,0x12,0x08,0x12,0x08,0x83,0xF8,0x42,0x08,0x42,0x08,0x13,0xF8,
0x10,0x00,0x27,0xFC,0xE4,0xA4,0x24,0xA4,0x24,0xA4,0x24,0xA4,0x2F,0xFE,0x00,0x00,/*"温",0*/
"度",0x01,0x00,0x00,0x80,0x3F,0xFE,0x22,0x20,0x22,0x20,0x3F,0xFC,0x22,0x20,0x22,0x20,
0x23,0xE0,0x20,0x00,0x2F,0xF0,0x24,0x10,0x42,0x20,0x41,0xC0,0x86,0x30,0x38,0x0E,/*"度",0*/
"湿",0x00,0x00,0x27,0xF8