2. 清除某个点 display.clearPixel
void OLEDDisplay::clearPixel(int16_t x, int16_t y)
3. 显示, 显示buf区的内容 display.display
void SSD1306Wire::display()
4. 把显示屏关掉 display.displayOff();
5. 把显示屏打开 display.displayOn();
6. 深度睡眠后恢复 display.allocateBuffer();
//使用它可以在深度睡眠后恢复而不重置显示(init()会做什么)。
7. 关闭OLED,清除对象和缓存 display.end();
void OLEDDisplay::end()
8. 屏幕垂直翻转 display.flipScreenVertically();
display.flipScreenVertically();
9. 屏幕镜像显示 display.mirrorScreen();
display.mirrorScreen();
10. 反色显示 display.invertDisplay();
display.invertDisplay();
11. 回归正常显示 display.normalDisplay();
display.normalDisplay();
12. 重新初始化 display.resetDisplay();
display.resetDisplay();
13. 重置显示方向 display.resetOrientation();
display.resetOrientation();
14. 设置显示亮度 display.setBrightness();
void OLEDDisplay::setBrightness(uint8_t)
15. 设置对比度 display.setContrast()
void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge = (uint8_t)'�', uint8_t comdetect = (uint8_t)'@')
2. 画空心圆 display.drawCircle
void OLEDDisplay::drawCircle(int16_t x, int16_t y, int16_t radius)
3. 画实心圆 display.fillCircle
void OLEDDisplay::fillCircle(int16_t x, int16_t y, int16_t radius)
4. 画1/4圆弧 display.drawCircleQuads
void OLEDDisplay::drawCircleQuads(int16_t x0, int16_t y0, int16_t radius, uint8_t quads)
5. 画水平线 display.drawHorizontalLine
void OLEDDisplay::drawHorizontalLine(int16_t x, int16_t y, int16_t length)
6. 画垂直线 display.drawVerticalLine
void OLEDDisplay::drawVerticalLine(int16_t x, int16_t y, int16_t length)
7. 画线 display.drawLine
void OLEDDisplay::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1)
8. 画空心矩形 display.drawRect
void OLEDDisplay::drawRect(int16_t x, int16_t y, int16_t width, int16_t height)
9. 画实心矩形 display.fillRect
void OLEDDisplay::fillRect(int16_t x, int16_t y, int16_t width, int16_t height)
10. 画进度条 display.drawProgressBar
void OLEDDisplay::drawProgressBar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t progress)| 内建字体 | 字高 | 字宽 | 包含字符 |
| ArialMT_Plain_10 | 13 | 10 | 224个字符 |
| ArialMT_Plain_16 | 19 | 16 | 224个字符 |
| ArialMT_Plain_24 | 28 | 24 | 224个字符 |
2. 设置文本对齐方法 display.setTextAlignment()
void OLEDDisplay::setTextAlignment(OLEDDISPLAY_TEXT_ALIGNMENT textAlignment)| 对齐方法 | 描述 |
| TEXT_ALIGN_LEFT | 左对齐 |
| TEXT_ALIGN_RIGHT | 右对齐 |
| TEXT_ALIGN_CENTER | 居中对齐 |
| TEXT_ALIGN_CENTER_BOTH | 上下左右对齐 |
3. 绘制字符串 display.drawString
用默认或设置好的字体绘制字符串
4. 绘制字符串(带最大宽度) display.drawStringMaxWidth
到达最大宽度回换行显示
#include "SSD1306Wire.h"
SSD1306Wire display(0x3c, 21, 22);
const char image[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x70, 0x03, 0x18, 0x06, 0x08, 0x04, 0x08, 0x04,
0x00, 0x06, 0x80, 0x03, 0xE0, 0x00, 0xC0, 0x01, 0x00, 0x01, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, /*"未命名文件",0*/
};
void setup()
{
Serial.begin(115200);
display.init();
display.flipScreenVertically();
display.clear();
display.drawIco16x16(0, 0, image, 0);
display.display();
}
void loop()
{
}
MimiClaw 是一款基于 ESP32-S3 芯片的超轻量级AI助手,适合嵌入式AI与物联网开发者快速部署本地化AI代理。本系列教程基于MimiClaw的Arduino移植版本进行讲解,小节主要讲解部署和测试。
就像我们用手机打开WiFi功能后可以浏览附近的可用WiFi。要将手机连接到热点,通常需要打开Wi-Fi设置应用程序,列出可用的网络,然后选择所需的热点。然后输入密码(或不输入密码),可以使用ESP32进行相同的操作。
本文本介绍配置飞书机器人为MimiClaw的一个输入/输出端,和添加一个控制WS2812与LED的控制技能。
一块 30 块钱的开发板 + 一个大模型 API,就能做出可以听懂人话的智能硬件。 本文记录完整安装过程和踩坑经验,确保你跟着做就能跑通。
本文将从手绘架构图入手,逐层拆解 MimiClaw 的分层设计、核心模块、数据流转与底层实现,带你解剖这只“智能虾”的技术骨架,看懂在 C 语言加持下,AI 智能体如何以可穿戴设备的形态,在你身边稳稳运行、离线服务、主动响应。
本文介绍如何在不脱离 ArduinoIDE 可视化开发的前提下,通过一个名为 platform.local.txt 的小文件,实现对 ESP32 编译流程的精准控制。
本文将系统分析程序体积增长的五大根源,并提供经过验证的优化方案,帮助减小固件大小。
本文所DIY的语音助手设备端使用的是MicroPython、服务端是Python,对于很多开发者来说MicroPython入门没难度。
本小节使用音频开发框架实现一个音频录制到文件的示例。
I2S协议通过BCLK、LRCLK和DATA三线精准传输音频数据,但时序边沿、帧格式、时钟源等细节常引发噪声或断连。本文详解ESP32的I2S实现,从协议原理到ESP-IDF v5.x代码配置,助你避开常见陷阱,确保音频稳定传输。