OLED屏
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[ESP32]]
&color(red){※This article is based on esp-idf 4.0};
#contents
* 下载 [#q6a28356]
https://github.com/olikraus/u8g2
* 安装 [#t435b07f]
+ Create a directory called components in your main proje...
+ Change into the components directory.
+ Run git clone https://github.com/mkfrey/u8g2-hal-esp-id...
+ Run git clone https://github.com/olikraus/u8g2.git to b...
* IIC接口 [#e4033cf5]
ESP32 的硬件IIC默认的接口
#codeprettify{{
// SDA - GPIO21
#define PIN_SDA 21
// SCL - GPIO22
#define PIN_SCL 22
}}
参考:
https://blog.csdn.net/quangui666/article/details/81483645
* 显示 [#x0a9f047]
官方的函数的一览
https://github.com/olikraus/u8g2/wiki/u8g2reference#begin
** u8g2中文字库参考 [#c3d700e0]
#codeprettify{{
u8g2_SetFont(&u8g2, u8g2_font_wqy12_t_gb2312); //设置使用...
u8g2_DrawUTF8(&u8g2,65,40,"你好world");
}}
https://github.com/larryli/u8g2_wqy
** 英文字库 [#ld9a1546]
https://github.com/olikraus/u8g2/wiki/fntlistall
** u8g2自定义图片显示 [#g1206603]
把png、jpg等图片格式裁剪到合适大小,裁剪后统一保存成位图...
OLED是128x64的像素尺寸,一般裁剪成30x20大小较为合适。
方法二:可以使用如下工具进行图片到数组的转换:
https://tools.clz.me/image-to-bitmap-array
** u8g2_font_unifont_t_symbols [#i0397350]
显示符号函数
#codeprettify{{
//设置字体
u8g2_SetFont(&u8g2, u8g2_font_unifont_t_symbols);
u8g2_DrawGlyph(&u8g2, x, y, 0x2665);
//输出♥
}}
&ref(u8g2_symbol.png);
* 问题 [#w802624e]
** 编译错误 [#z4a66043]
#codeprettify{{
components/u8g2/csrc/u8x8_d_ssd1320.c:339:22: error: 'u8x...
static const uint8_t u8x8_d_ssd1320_cs1_160x132_init_seq...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}}
&ref(ZigBee_体系结构.png);
#hr();
コメント:
#comment_kcaptcha
終了行:
[[ESP32]]
&color(red){※This article is based on esp-idf 4.0};
#contents
* 下载 [#q6a28356]
https://github.com/olikraus/u8g2
* 安装 [#t435b07f]
+ Create a directory called components in your main proje...
+ Change into the components directory.
+ Run git clone https://github.com/mkfrey/u8g2-hal-esp-id...
+ Run git clone https://github.com/olikraus/u8g2.git to b...
* IIC接口 [#e4033cf5]
ESP32 的硬件IIC默认的接口
#codeprettify{{
// SDA - GPIO21
#define PIN_SDA 21
// SCL - GPIO22
#define PIN_SCL 22
}}
参考:
https://blog.csdn.net/quangui666/article/details/81483645
* 显示 [#x0a9f047]
官方的函数的一览
https://github.com/olikraus/u8g2/wiki/u8g2reference#begin
** u8g2中文字库参考 [#c3d700e0]
#codeprettify{{
u8g2_SetFont(&u8g2, u8g2_font_wqy12_t_gb2312); //设置使用...
u8g2_DrawUTF8(&u8g2,65,40,"你好world");
}}
https://github.com/larryli/u8g2_wqy
** 英文字库 [#ld9a1546]
https://github.com/olikraus/u8g2/wiki/fntlistall
** u8g2自定义图片显示 [#g1206603]
把png、jpg等图片格式裁剪到合适大小,裁剪后统一保存成位图...
OLED是128x64的像素尺寸,一般裁剪成30x20大小较为合适。
方法二:可以使用如下工具进行图片到数组的转换:
https://tools.clz.me/image-to-bitmap-array
** u8g2_font_unifont_t_symbols [#i0397350]
显示符号函数
#codeprettify{{
//设置字体
u8g2_SetFont(&u8g2, u8g2_font_unifont_t_symbols);
u8g2_DrawGlyph(&u8g2, x, y, 0x2665);
//输出♥
}}
&ref(u8g2_symbol.png);
* 问题 [#w802624e]
** 编译错误 [#z4a66043]
#codeprettify{{
components/u8g2/csrc/u8x8_d_ssd1320.c:339:22: error: 'u8x...
static const uint8_t u8x8_d_ssd1320_cs1_160x132_init_seq...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}}
&ref(ZigBee_体系结构.png);
#hr();
コメント:
#comment_kcaptcha
ページ名: