※This article is based on esp-idf 4.0
https://github.com/olikraus/u8g2
ESP32 的硬件IIC默认的接口
// SDA - GPIO21 #define PIN_SDA 21 // SCL - GPIO22 #define PIN_SCL 22
参考:
https://blog.csdn.net/quangui666/article/details/81483645
官方的函数的一览
https://github.com/olikraus/u8g2/wiki/u8g2reference#begin
u8g2_SetFont(&u8g2, u8g2_font_wqy12_t_gb2312); //设置使用哪个汉字库 u8g2_DrawUTF8(&u8g2,65,40,"你好world");
https://github.com/larryli/u8g2_wqy
把png、jpg等图片格式裁剪到合适大小,裁剪后统一保存成位图格式。然后使用PCtoLCD2002软件,生成位图数组,再写入u8g2显示。
OLED是128x64的像素尺寸,一般裁剪成30x20大小较为合适。
显示符号函数
//设置字体 u8g2_SetFont(&u8g2, u8g2_font_unifont_t_symbols); u8g2_DrawGlyph(&u8g2, x, y, 0x2665); //输出♥
components/u8g2/csrc/u8x8_d_ssd1320.c:339:22: error: 'u8x8_d_ssd1320_cs1_160x132_init_seq' defined but not used [-Werror=unused-const-variable=] static const uint8_t u8x8_d_ssd1320_cs1_160x132_init_seq[] = { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&ref(): File not found: "ZigBee_体系结构.png" at page "+ESP32+OLED屏";
コメント: